def loop(): interval_list = input('> List of intervals? ') new_interval = input('> Interval? ') while((new_interval == 'quit') == False and ((new_interval == 'QUIT') == False) and (new_interval == 'Quit') == False): interval_sample = interval(new_interval, 1) if interval_sample.valid_string == 1: interval_list = interval_sample.insert(interval_list, new_interval) interval_list = ', '.join(interval_list) print(interval_list) new_interval = input('> Interval? ')
def loop(): interval_list = input('> List of intervals? ') new_interval = input('> Interval? ') while ((new_interval == 'quit') == False and ((new_interval == 'QUIT') == False) and (new_interval == 'Quit') == False): interval_sample = interval(new_interval, 1) if interval_sample.valid_string == 1: interval_list = interval_sample.insert(interval_list, new_interval) interval_list = ', '.join(interval_list) print(interval_list) new_interval = input('> Interval? ')
def setUp(self): self.int = interval('[1,2]', 0) # A sample instance of the class 'interval' is created --> so that we don't need to create
def test_input_as_string(self): test_interval = interval('fooooo', 0) self.assertEqual(test_interval.valid_string, 0)
def test_incomplete_input(self): test_interval = interval('[234,678', 0) self.assertEqual(test_interval.valid_string, 0)
def test_constructor_invalid_string_exclusive_bounds_type_2(self): test_interval = interval('(2,3)', 0) self.assertEqual(test_interval.valid_string, 0)
def test_constructor_invalid_string_inclusive_and_exclusive_bounds_type_3(self): test_interval = interval('(5,3]', 0) self.assertEqual(test_interval.valid_string, 0)
def test_constructor_invalid_string_inclusive_bounds(self): test_interval = interval('[6,5]', 0) self.assertEqual(test_interval.valid_string, 0)
def setUp(self): self.int = interval( '[1,2]', 0 ) # A sample instance of the class 'interval' is created --> so that we don't need to create
def setUp(self): self.int = interval('[1,2]', 0)
def setUp(self): test_interval = interval( '[1,2]', 0 ) # the second parameter(to_print_or_not) is 0 because we don't want to print "Invalid Input" for invalid inputs while running test cases test_interval.to_print_or_not = 0
def test_constructor_invalid_string_inclusive_and_exclusive_bounds_type_3( self): test_interval = interval('(5,3]', 0) self.assertEqual(test_interval.valid_string, 0)
def setUp(self): test_interval = interval('[1,2]', 0) # the second parameter(to_print_or_not) is 0 because we don't want to print "Invalid Input" for invalid inputs while running test cases test_interval.to_print_or_not = 0
def test_constructor_valid_string(self): test_interval = interval('[2,5]', 0) self.assertEqual(test_interval.valid_string, 1)