Ejemplo n.º 1
0
 def test_get_next_test(self):
     ''' Check get_next_test() works OK when we have more than one test '''
     #
     # When we have more than one test, it should not return the
     # same test two times in a row.  Not so clever, but that's
     # the way the current code is working.
     #
     lst = RunnerLst()
     lst.update({'foo': ['a', 'b', 'c'], 'bar': ['a', 'b', 'c']})
     nxt = lst.get_next_test()
     self.assertNotEqual(lst.get_next_test(), nxt)
Ejemplo n.º 2
0
 def test_test_to_negotiate_uri(self):
     ''' Check test_to_negotiate_uri works as expected '''
     #
     # It should always return the first URI: it suck but that is
     # how it works as of now.
     #
     lst = RunnerLst()
     lst.update({'foo': ['a', 'b', 'c']})
     self.assertEqual(lst.test_to_negotiate_uri('foo'), 'a')
     self.assertEqual(lst.test_to_negotiate_uri('foo'), 'a')
     self.assertEqual(lst.test_to_negotiate_uri('foo'), 'a')
Ejemplo n.º 3
0
 def test_get_next_test_simple(self):
     ''' Check get_next_test() works OK when we have just one test '''
     #
     # When we have just one test it should always return that
     # test name, I know that seems silly but we need to ensure
     # it works OK because that is a special case in the code.
     #
     lst = RunnerLst()
     lst.update({'foo': ['a', 'b', 'c']})
     self.assertEqual(lst.get_next_test(), 'foo')
     self.assertEqual(lst.get_next_test(), 'foo')
     self.assertEqual(lst.get_next_test(), 'foo')
Ejemplo n.º 4
0
 def test_when_empty(self):
     ''' Check behavior is correct when empty '''
     # It should return None in both cases
     lst = RunnerLst()
     self.assertEqual(lst.test_to_negotiate_uri('foo'), None)
     self.assertEqual(lst.get_next_test(), None)