3 from db_test import DBDakTestCase
7 from daklib.utils import extract_component_from_section
9 class ExtractComponentTestCase(DBDakTestCase):
12 component: main, contrib, non-free
13 section: games, admin, libs, [...]
15 [1] Order is as above.
16 [2] Prefix is optional for the default archive, but mandatory when
17 uploads are going anywhere else.
18 [3] Default component is main and may be omitted.
19 [4] Section is optional.
20 [5] Prefix is case insensitive
21 [6] Everything else is case sensitive.
24 def assertExtract(self, input, output):
25 self.setup_components()
27 extract_component_from_section(input, self.session)[1],
33 self.assertExtract('utils', 'main')
36 # Err, whoops? should probably be 'utils', 'main'...
37 self.assertExtract('main/utils', 'main')
40 self.assertExtract('non-free/libs', 'non-free')
43 self.assertExtract('contrib/net', 'contrib')
47 self.assertExtract('main', 'main')
50 self.assertExtract('contrib', 'contrib')
53 self.assertExtract('non-free', 'non-free')
56 # Validate #6 (section)
57 self.assertExtract('utIls', 'main')
59 if __name__ == '__main__':