Newer
Older
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
diff -ru source/CommandNotFound/db/tests/test_db.py source/CommandNotFound/db/tests/test_db.py_fix
--- source/CommandNotFound/db/tests/test_db.py 2021-12-08 04:53:19.000000000 -0600
+++ source/CommandNotFound/db/tests/test_db.py_fix 2022-08-26 01:26:06.984427040 -0500
@@ -11,7 +11,7 @@
from CommandNotFound.db.creator import DbCreator
from CommandNotFound.db.db import SqliteDatabase
-mock_commands_bionic_backports = """suite: bionic-backports
+mock_commands_etiona_backports = """suite: etiona-backports
component: main
arch: all
@@ -20,7 +20,7 @@
commands: script,wall,new-stuff-only-in-backports
"""
-mock_commands_bionic_proposed = """suite: bionic-proposed
+mock_commands_etiona_proposed = """suite: etiona-proposed
component: main
arch: all
@@ -29,7 +29,7 @@
commands: script,wall
"""
-mock_commands_bionic = """suite: bionic
+mock_commands_etiona = """suite: etiona
component: main
arch: all
@@ -65,7 +65,7 @@
ignore-commands: ignore-me
"""
-mock_commands_bionic_universe = """suite: bionic
+mock_commands_etiona_universe = """suite: etiona
component: universe
arch: all
@@ -84,7 +84,7 @@
shutil.rmtree(self.tmpdir)
def make_mock_commands_file(self, suite, content):
- path = os.path.join(self.tmpdir, "var", "lib", "apt", "lists", "archive.ubuntu.com_ubuntu_dists_%s_Commands-all" % suite)
+ path = os.path.join(self.tmpdir, "var", "lib", "apt", "lists", "archive.trisquel.org_trisquel_dists_%s_Commands-all" % suite)
try:
os.makedirs(os.path.dirname(path))
except OSError:
@@ -95,7 +95,7 @@
def test_create_trivial_db(self):
mock_commands_file = self.make_mock_commands_file(
- "bionic_main", mock_commands_bionic)
+ "etiona_main", mock_commands_etiona)
cre = DbCreator([mock_commands_file])
dbpath = os.path.join(self.tmpdir, "test.db")
cre.create(dbpath)
@@ -108,9 +108,9 @@
def test_create_multiple_dbs(self):
mock_commands_1 = self.make_mock_commands_file(
- "bionic_main", mock_commands_bionic)
+ "etiona_main", mock_commands_etiona)
mock_commands_2 = self.make_mock_commands_file(
- "bionic-proposed_main", mock_commands_bionic_proposed)
+ "etiona-proposed_main", mock_commands_etiona_proposed)
cre = DbCreator([mock_commands_1, mock_commands_2])
dbpath = os.path.join(self.tmpdir, "test.db")
cre.create(dbpath)
@@ -131,9 +131,9 @@
def test_create_backports_excluded_dbs(self):
mock_commands_1 = self.make_mock_commands_file(
- "bionic_main", mock_commands_bionic)
+ "etiona_main", mock_commands_etiona)
mock_commands_2 = self.make_mock_commands_file(
- "bionic-backports_main", mock_commands_bionic_backports)
+ "etiona-backports_main", mock_commands_etiona_backports)
cre = DbCreator([mock_commands_1, mock_commands_2])
dbpath = os.path.join(self.tmpdir, "test.db")
cre.create(dbpath)
@@ -146,7 +146,7 @@
def test_create_no_versions_does_not_crash(self):
mock_commands = self.make_mock_commands_file(
- "bionic_main", mock_commands_bionic.replace("version: 1.0\n", ""))
+ "etiona_main", mock_commands_etiona.replace("version: 1.0\n", ""))
cre = DbCreator([mock_commands])
dbpath = os.path.join(self.tmpdir, "test.db")
cre.create(dbpath)
@@ -157,11 +157,8 @@
def test_create_priorities_work(self):
mock_commands_1 = self.make_mock_commands_file(
- "bionic_main", mock_commands_bionic)
- mock_commands_2 = self.make_mock_commands_file(
- "bionic_universe", mock_commands_bionic_universe)
- self.assertNotEqual(mock_commands_1, mock_commands_2)
- cre = DbCreator([mock_commands_1, mock_commands_2])
+ "etiona_main", mock_commands_etiona)
+ cre = DbCreator([mock_commands_1])
dbpath = os.path.join(self.tmpdir, "test.db")
cre.create(dbpath)
# validate content
@@ -173,12 +170,11 @@
db.lookup("bzr"), [
("bzr1", "1.0", "main"),
("bzr2", "2.7", "main"),
- ("bzr-tng", "3.0", "universe"),
])
def test_priorities_bonus_works(self):
mock_commands_1 = self.make_mock_commands_file(
- "bionic_main", mock_commands_bionic)
+ "etiona_main", mock_commands_etiona)
cre = DbCreator([mock_commands_1])
dbpath = os.path.join(self.tmpdir, "test.db")
cre.create(dbpath)
@@ -193,7 +189,7 @@
def test_visible_pkgname_works(self):
mock_commands_1 = self.make_mock_commands_file(
- "bionic_main", mock_commands_bionic)
+ "etiona_main", mock_commands_etiona)
cre = DbCreator([mock_commands_1])
dbpath = os.path.join(self.tmpdir, "test.db")
cre.create(dbpath)
@@ -205,9 +201,9 @@
def test_create_multiple_no_unneeded_creates(self):
mock_commands_1 = self.make_mock_commands_file(
- "bionic_main", mock_commands_bionic)
+ "etiona_main", mock_commands_etiona)
mock_commands_2 = self.make_mock_commands_file(
- "bionic-proposed_main", mock_commands_bionic_proposed)
+ "etiona-proposed_main", mock_commands_etiona_proposed)
cre = DbCreator([mock_commands_1, mock_commands_2])
dbpath = os.path.join(self.tmpdir, "test.db")
cre.create(dbpath)
@@ -220,7 +216,7 @@
def test_create_honors_ignore_comamnds(self):
mock_commands_file = self.make_mock_commands_file(
- "bionic_main", mock_commands_bionic)
+ "etiona_main", mock_commands_etiona)
cre = DbCreator([mock_commands_file])
dbpath = os.path.join(self.tmpdir, "test.db")
cre.create(dbpath)