def test_write_env_name(data, name): with fake_envfile(): dump_environment_to_yaml_file('test.yml', data) write_env_name(name, 'test.yml') assert get_environment_dict('test.yml')['name'] == name
def test_write_env_name_no_name(self): data = {'channels': ['defaults'], 'dependencies': ['mixpanel=1.11.0'], 'prefix': '/home/admin/anaconda3/envs/test-env'} dump_environment_to_yaml_file('test.yml', data) write_env_name('test-env', 'test.yml') expected_result = 'test-env' self.assertEqual(get_environment_dict('test.yml')['name'], expected_result)
def tearDown(self): write_env_name('test-env', 'environment-test.yml') super().tearDown()