Esempio n. 1
0
 def test__focus_can_be_moved_up(self):
     data = ['one', 'two', 'three']
     selector = project_selector.ProjectSelector(data, '', '', '')
     self.assertEqual(0, selector.focus)
     selector.down()
     selector.up()
     self.assertEqual(0, selector.focus)
Esempio n. 2
0
 def test__removing_key(self):
     data = ['one', 'two', 'three']
     selector = project_selector.ProjectSelector(data, '', '', '')
     selector.add_key('o')
     selector.remove_key()
     self.assertEqual('', selector.keys)
     selector.remove_key()
     self.assertEqual('', selector.keys)
Esempio n. 3
0
 def test__data_in_focus_will_be_returned_on_selection_from_the_filtered_list(
         self):
     data = ['a', 'b', 'c']
     selector = project_selector.ProjectSelector(data, '', '', '')
     selector.down()
     expected = 'b'
     result = selector.select()
     self.assertEqual(expected, result)
Esempio n. 4
0
 def test__focus_has_lower_limit(self):
     data = ['one', 'two', 'three']
     selector = project_selector.ProjectSelector(data, '', '', '')
     selector.down()
     selector.down()
     self.assertEqual(2, selector.focus)
     selector.down()
     self.assertEqual(2, selector.focus)
Esempio n. 5
0
 def test__adding_key_is_only_possible_if_there_are_match(self):
     data = ['one', 'two', 'three']
     selector = project_selector.ProjectSelector(data, '', '', '')
     self.assertEqual('', selector.keys)
     selector.add_key('a')
     self.assertEqual('', selector.keys)
     selector.add_key('o')
     self.assertEqual('o', selector.keys)
     selector.add_key('e')
     self.assertEqual('oe', selector.keys)
     selector.add_key('l')
     self.assertEqual('oe', selector.keys)
Esempio n. 6
0
 def test__project_selector_can_be_initialized(self):
     data = ['one', 'two', 'three']
     selector = project_selector.ProjectSelector(data, '', '', '')
     self.assertEqual(data, selector.data)
     self.assertEqual('', selector.keys)
     self.assertEqual(0, selector.focus)