def test_no_bear_object(self): if not os.path.exists(self.NO_BEAR_PATH): os.makedirs(os.path.join('bears', 'BadBear')) touch(self.NO_BEAR_PATH) main() self.assertFalse(os.path.exists(os.path.join( 'bears', 'upload', 'BadBear'))) shutil.rmtree(os.path.join('bears', 'BadBear'))
def test_no_bear_object(self): if not os.path.exists(self.NO_BEAR_PATH): os.makedirs(os.path.join(self.BEARS_PATH, 'BadBear')) touch(self.NO_BEAR_PATH) main() self.assertFalse( os.path.exists(os.path.join(self.BEARS_UPLOAD_PATH, 'BadBear'))) shutil.rmtree(os.path.join(self.BEARS_PATH, 'BadBear'))
def test_structure(self): touch('TestFile.py') create_file_structure_for_packages('folder', 'TestFile.py', 'Test') self.assertTrue(os.path.exists(self.TEST_FILE_PATH)) self.assertTrue(os.path.exists(self.INIT_FILE_PATH))
def test_file_doesnt_exist(self): self.assertFalse(os.path.exists('TestFile.py')) touch('TestFile.py') self.assertTrue(os.path.exists('TestFile.py'))
def test_structure(self): touch('TestFile.py') create_file_structure_for_packages('folder', 'TestFile.py', 'Test') self.assertTrue(os.path.exists(self.INIT_FILE_PATH)) self.assertTrue(os.path.exists(self.BEAR_FILE_PATH))