Beispiel #1
0
 def test_duplicate_config_entry(self):
     self.assertEqual(
         arrange(
             self.abc, ['a', 'b', 'a'],
             Options(filename='',
                     collapse_single_pages=False,
                     hide_not_arranged_pages=False)), ['a', 'b', 'a', 'c'])
Beispiel #2
0
 def test_hide_not_arranged_pages(self):
     self.assertEqual(
         arrange(
             self.abc, ['a', 'c'],
             Options(filename='',
                     collapse_single_pages=False,
                     hide_not_arranged_pages=True)), ['a', 'c'])
Beispiel #3
0
 def test_empty_rest(self):
     self.assertEqual(
         arrange(
             self.abc, ['c', 'b', '...', 'a'],
             Options(filename='',
                     collapse_single_pages=False,
                     hide_not_arranged_pages=False)), ['c', 'b', 'a'])
Beispiel #4
0
 def test_some_in_config(self):
     self.assertEqual(
         arrange(
             self.abc, ['b'],
             Options(filename='',
                     collapse_single_pages=False,
                     hide_not_arranged_pages=False)), ['b', 'a', 'c'])
Beispiel #5
0
 def test_key_function(self):
     a = {'id': 'a'}
     b = {'id': 'b'}
     c = {'id': 'c'}
     self.assertEqual(
         arrange([a, b, c], ['c', 'a', 'b'],
                 Options(filename='',
                         collapse_single_pages=False,
                         hide_not_arranged_pages=False), lambda x: x['id']),
         [c, a, b])
Beispiel #6
0
 def test_invalid_entry(self):
     with self.assertRaises(InvalidArrangeEntry):
         arrange(['a', 'b', 'c'], ['b', 'c', 'a', 'd'],
                 Options(filename='',
                         collapse_single_pages=False,
                         hide_not_arranged_pages=False))