Exemplo n.º 1
0
 def test_can_make_package_directory(self):
     create_package("testpack", "container")
     self.assertTrue(os.path.exists("container/testpack"))
Exemplo n.º 2
0
 def test_license_creator_can_vary_license(self, mock_creator):
     create_package("testpack", "container", license="gnu")
     mock_creator.assert_called_with("container/testpack", "gnu", "")
Exemplo n.º 3
0
 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")
Exemplo n.º 4
0
 def test_license_creator_called_by_default(self, mock_creator):
     create_package("testpack", "container")
     mock_creator.assert_called_with("container/testpack", "mit", "")
Exemplo n.º 5
0
 def test_can_choose_not_to_create_license(self, mock_creator):
     create_package("testpack", "container", license=False)
     self.assertFalse(mock_creator.called)
Exemplo n.º 6
0
 def test_location_must_be_str(self):
     with self.assertRaises(TypeError):
         create_package("testpack", 100)
Exemplo n.º 7
0
 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")
Exemplo n.º 8
0
 def test_can_provide_env_name(self, mock_env):
     create_package("testpack", "container", env="macenv")
     mock_env.assert_called_with("container/testpack", name="macenv")
Exemplo n.º 9
0
 def test_py_package_creator_called(self, mock_creator):
     create_package("testpack", "container")
     mock_creator.assert_called_with("container/testpack",
                                     "testpack",
                                     author=None)
Exemplo n.º 10
0
 def test_can_choose_to_create_env(self, mock_env):
     create_package("testpack", "container", env=True)
     mock_env.assert_called_with("container/testpack")
Exemplo n.º 11
0
 def test_create_env_not_called_by_default(self, mock_env):
     create_package("testpack", "container")
     self.assertFalse(mock_env.called)
Exemplo n.º 12
0
 def test_can_choose_not_to_git_init(self, mock_ignore):
     create_package("testpack", "container", git=False)
     self.assertFalse(mock_ignore.called)
Exemplo n.º 13
0
 def test_git_ignore_called_by_default(self, mock_ignore):
     create_package("testpack", "container")
     mock_ignore.assert_called_with("container/testpack")
Exemplo n.º 14
0
 def test_package_must_be_str(self):
     with self.assertRaises(TypeError):
         create_package(100, "container")