Пример #1
0
 def test_parse_command_line_parameter_should_accept_equals_in_parameter(self):
     # because the parameter value could be a string containing "="
     value = "save=Data/result.uwsize=48.setsize=1"
     result = commands.parse_command_line_parameter(value)
     self.assertEqual(result, {'save': 'Data/result.uwsize=48.setsize=1'})
Пример #2
0
 def test_parse_command_line_parameter_with_list(self):
     result = commands.parse_command_line_parameter("c=[1,2,3,4,5]")
     self.assertEqual(result, {'c': [1, 2, 3, 4, 5]})
Пример #3
0
 def test_parse_command_line_parameter_with_tuple(self):
     result = commands.parse_command_line_parameter("d=('a','b','c')")
     self.assertEqual(result, {'d': ('a', 'b', 'c')})
Пример #4
0
 def test_parse_command_line_parameter_with_int(self):
     result = commands.parse_command_line_parameter("a=2")
     self.assertEqual(result, {'a': 2})
     assert isinstance(result['a'], int)
Пример #5
0
 def test_parse_command_line_parameter_with_float(self):
     result = commands.parse_command_line_parameter("b=2.0")
     self.assertEqual(result, {'b': 2.0})
     assert isinstance(result['b'], float)
Пример #6
0
 def test_parse_command_line_parameter_should_accept_equals_in_parameter(
         self):
     # because the parameter value could be a string containing "="
     value = "save=Data/result.uwsize=48.setsize=1"
     result = commands.parse_command_line_parameter(value)
     self.assertEqual(result, {'save': 'Data/result.uwsize=48.setsize=1'})
Пример #7
0
 def test_parse_command_line_parameter_with_tuple(self):
     result = commands.parse_command_line_parameter("d=('a','b','c')")
     self.assertEqual(result, {'d': ('a', 'b', 'c')})
Пример #8
0
 def test_parse_command_line_parameter_with_list(self):
     result = commands.parse_command_line_parameter("c=[1,2,3,4,5]")
     self.assertEqual(result, {'c': [1, 2, 3, 4, 5]})
Пример #9
0
 def test_parse_command_line_parameter_with_float(self):
     result = commands.parse_command_line_parameter("b=2.0")
     self.assertEqual(result, {'b': 2.0})
     assert isinstance(result['b'], float)
Пример #10
0
 def test_parse_command_line_parameter_with_int(self):
     result = commands.parse_command_line_parameter("a=2")
     self.assertEqual(result, {'a': 2})
     assert isinstance(result['a'], int)