def test_can_make_package_directory(self): create_package("testpack", "container") self.assertTrue(os.path.exists("container/testpack"))
def test_license_creator_can_vary_license(self, mock_creator): create_package("testpack", "container", license="gnu") mock_creator.assert_called_with("container/testpack", "gnu", "")
def test_license_creator_can_be_given_author(self, mock_creator): create_package("testpack", "container", author="Sam") mock_creator.assert_called_with("container/testpack", "mit", "Sam")
def test_license_creator_called_by_default(self, mock_creator): create_package("testpack", "container") mock_creator.assert_called_with("container/testpack", "mit", "")
def test_can_choose_not_to_create_license(self, mock_creator): create_package("testpack", "container", license=False) self.assertFalse(mock_creator.called)
def test_location_must_be_str(self): with self.assertRaises(TypeError): create_package("testpack", 100)
def test_py_package_creator_given_name(self, mock_creator): create_package("testpack", "container", author="Sam") mock_creator.assert_called_with("container/testpack", "testpack", author="Sam")
def test_can_provide_env_name(self, mock_env): create_package("testpack", "container", env="macenv") mock_env.assert_called_with("container/testpack", name="macenv")
def test_py_package_creator_called(self, mock_creator): create_package("testpack", "container") mock_creator.assert_called_with("container/testpack", "testpack", author=None)
def test_can_choose_to_create_env(self, mock_env): create_package("testpack", "container", env=True) mock_env.assert_called_with("container/testpack")
def test_create_env_not_called_by_default(self, mock_env): create_package("testpack", "container") self.assertFalse(mock_env.called)
def test_can_choose_not_to_git_init(self, mock_ignore): create_package("testpack", "container", git=False) self.assertFalse(mock_ignore.called)
def test_git_ignore_called_by_default(self, mock_ignore): create_package("testpack", "container") mock_ignore.assert_called_with("container/testpack")
def test_package_must_be_str(self): with self.assertRaises(TypeError): create_package(100, "container")