Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_cli_missing_yaml(self):
orig_has_yaml = f90nml.cli.has_yaml
f90nml.cli.has_yaml = False
cmd = ['f90nml', 'types.yaml']
source_str = self.get_cli_output(cmd, get_stderr=True)
target_str = ('f90nml: error: YAML module could not be found.\n'
' To enable YAML support, install PyYAML or use the f90nml[yaml] '
'package.\n')
self.assertEqual(source_str, target_str)
f90nml.cli.has_yaml = orig_has_yaml
def test_cli_missing_yaml(self):
orig_has_yaml = f90nml.cli.has_yaml
f90nml.cli.has_yaml = False
cmd = ['f90nml', 'types.yaml']
source_str = self.get_cli_output(cmd, get_stderr=True)
target_str = ('f90nml: error: YAML module could not be found.\n'
' To enable YAML support, install PyYAML or use the f90nml[yaml] '
'package.\n')
self.assertEqual(source_str, target_str)
f90nml.cli.has_yaml = orig_has_yaml
def test_cli_missing_yaml(self):
orig_has_yaml = f90nml.cli.has_yaml
f90nml.cli.has_yaml = False
cmd = ['f90nml', 'types.yaml']
source_str = self.get_cli_output(cmd, get_stderr=True)
target_str = ('f90nml: error: YAML module could not be found.\n'
' To enable YAML support, install PyYAML or use the f90nml[yaml] '
'package.\n')
self.assertEqual(source_str, target_str)
f90nml.cli.has_yaml = orig_has_yaml