예제 #1
0
 def test_can_make_package_directory(self):
     create_package("testpack", "container")
     self.assertTrue(os.path.exists("container/testpack"))
예제 #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", "")
예제 #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")
예제 #4
0
 def test_license_creator_called_by_default(self, mock_creator):
     create_package("testpack", "container")
     mock_creator.assert_called_with("container/testpack", "mit", "")
예제 #5
0
 def test_can_choose_not_to_create_license(self, mock_creator):
     create_package("testpack", "container", license=False)
     self.assertFalse(mock_creator.called)
예제 #6
0
 def test_location_must_be_str(self):
     with self.assertRaises(TypeError):
         create_package("testpack", 100)
예제 #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")
예제 #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")
예제 #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)
예제 #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")
예제 #11
0
 def test_create_env_not_called_by_default(self, mock_env):
     create_package("testpack", "container")
     self.assertFalse(mock_env.called)
예제 #12
0
 def test_can_choose_not_to_git_init(self, mock_ignore):
     create_package("testpack", "container", git=False)
     self.assertFalse(mock_ignore.called)
예제 #13
0
 def test_git_ignore_called_by_default(self, mock_ignore):
     create_package("testpack", "container")
     mock_ignore.assert_called_with("container/testpack")
예제 #14
0
 def test_package_must_be_str(self):
     with self.assertRaises(TypeError):
         create_package(100, "container")