blob: ada84f1c44260cf83b2f1a8a3f5097ab429ca257 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
import fnmatch
import os
import pytest
class TestUpgradepkg:
@pytest.mark.complete("upgradepkg -")
def test_1(self, completion):
assert completion
@pytest.mark.complete("upgradepkg --")
def test_2(self, completion):
assert (
completion == "--dry-run --install-new --reinstall "
"--verbose".split()
)
@pytest.mark.complete("upgradepkg ", cwd="slackware/home")
def test_4(self, completion):
expected = sorted(
[
"%s/" % x
for x in os.listdir("slackware/home")
if os.path.isdir("./%s" % x)
]
+ [
x
for x in os.listdir("slackware/home")
if os.path.isfile("./%s" % x)
and fnmatch.fnmatch(x, "*.t[bglx]z")
]
)
assert completion == expected
|