def test__normalize_args(self): ''' Test parallels._normalize_args ''' def _validate_ret(ret): ''' Assert that the returned data is a list of strings ''' self.assertTrue(isinstance(ret, list)) for arg in ret: self.assertTrue(isinstance(arg, six.string_types)) # Validate string arguments str_args = 'electrolytes --aqueous --anion hydroxide --cation=ammonium free radicals -- hydrogen' _validate_ret(parallels._normalize_args(str_args)) # Validate list arguments list_args = ' '.join(str_args) _validate_ret(parallels._normalize_args(list_args)) # Validate tuple arguments tuple_args = tuple(list_args) _validate_ret(parallels._normalize_args(tuple_args)) # Validate dictionary arguments other_args = {'anion': 'hydroxide', 'cation': 'ammonium'} _validate_ret(parallels._normalize_args(other_args))
def test__normalize_args(self): """ Test parallels._normalize_args """ def _validate_ret(ret): """ Assert that the returned data is a list of strings """ self.assertTrue(isinstance(ret, list)) for arg in ret: self.assertTrue(isinstance(arg, six.string_types)) # Validate string arguments str_args = "electrolytes --aqueous --anion hydroxide --cation=ammonium free radicals -- hydrogen" _validate_ret(parallels._normalize_args(str_args)) # Validate list arguments list_args = " ".join(str_args) _validate_ret(parallels._normalize_args(list_args)) # Validate tuple arguments tuple_args = tuple(list_args) _validate_ret(parallels._normalize_args(tuple_args)) # Validate dictionary arguments other_args = {"anion": "hydroxide", "cation": "ammonium"} _validate_ret(parallels._normalize_args(other_args))
def test__normalize_args(self): ''' Test parallels._normalize_args ''' def _validate_ret(ret): ''' Assert that the returned data is a list of strings ''' self.assertTrue(isinstance(ret, list)) for arg in ret: self.assertTrue(isinstance(arg, six.string_types)) # Validate string arguments str_args = 'electrolytes --aqueous --anion hydroxide --cation=ammonium free radicals -- hydrogen' _validate_ret(parallels._normalize_args(str_args)) # Validate list arguments list_args = ' '.join(str_args) _validate_ret(parallels._normalize_args(list_args)) # Validate tuple arguments tuple_args = tuple(list_args) _validate_ret(parallels._normalize_args(tuple_args)) # Validate dictionary arguments other_args = {'anion': 'hydroxide', 'cation': 'ammonium'} _validate_ret(parallels._normalize_args(other_args))