def test_create_metric_config_if_not_exists_existing(tmpdir): metric_config = tmpdir.join('metric_config.yaml') with tmpdir.as_cwd(): metric_config.write('Groups: []\nColorOverrides: []\n') create_metric_config_if_not_exists() after_contents = metric_config.read() assert after_contents == 'Groups: []\nColorOverrides: []\n'
def test_create_metric_config_if_not_exists_existing(tmpdir): with cwd(tmpdir.strpath): with io.open( 'metric_config.yaml', 'w', ) as metric_config_file: # pragma: no cover (PY26 derps on `with`) metric_config_file.write('Groups: []\nColorOverrides: []\n') create_metric_config_if_not_exists() after_contents = io.open('metric_config.yaml').read() assert after_contents == 'Groups: []\nColorOverrides: []\n'
def test_create_metric_config_if_not_exists_not_existing(tmpdir): with cwd(tmpdir.strpath): create_metric_config_if_not_exists() assert os.path.exists('metric_config.yaml')
def test_create_metric_config_if_not_exists_not_existing(tmpdir): with tmpdir.as_cwd(): create_metric_config_if_not_exists() assert tmpdir.join('metric_config.yaml').exists()