From 727273afabbe75766a2a5f2d55cc24899e8d7730 Mon Sep 17 00:00:00 2001 From: parth-p Date: Mon, 30 Oct 2017 19:59:07 +0530 Subject: [PATCH 1/2] Test for checking files in repo --- test/test_files.py | 75 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 test/test_files.py diff --git a/test/test_files.py b/test/test_files.py new file mode 100644 index 0000000..e99b4da --- /dev/null +++ b/test/test_files.py @@ -0,0 +1,75 @@ +import os + +try: + import unittest2 as unittest +except ImportError: + import unittest + +class ProjectTests(unittest.TestCase): + + # ./Docker or docker/Docker + def test_docker_dir(self): + self.assertEqual(True, os.path.isdir("./Docker")) + + # ./docker-compose.yml or ./docker/docker-compose.yml + def test_docker_compose(self): + self.assertEqual(True, os.path.isfile('docker-compose.yml')) + + # ./.env_sample + def test_env(self): + self.assertEqual(True, os.path.isfile('./env_sample')) + + # ./.gitignore + def test_gitignore(self): + self.assertEqual(True, os.path.isfile('./.gitignore')) + + # ./.travis.yml + def test_travis(self): + self.assertEqual(True, os.path.isfile('./.travis.yml')) + + # ./.codeclimate.yml + def test_codeclimate(self): + self.assertEqual(True, os.path.isfile('./.codeclimate.yml')) + + # ./CHANGELOG.md + def test_changelog(self): + self.assertEqual(True, os.path.isfile('./CHANGELOG.md')) + + # ./CODE_OF_CONDUCT.md + def test_code_of_conduct(self): + self.assertEqual(True, os.path.isfile('./CODE_OF_CONDUCT.md')) + + # ./CONTRIBUTING.md + def test_contributing(self): + self.assertEqual(True, os.path.isfile('./CONTRIBUTING.md')) + + # ./.github/ISSUE_TEMPLATE + def test_issue_template(self): + self.assertEqual(True, os.path.isfile('./.github/ISSUE_TEMPLATE')) + + # ./LICENSE.md + def test_license(self): + self.assertEqual(True, os.path.isfile('./LICENSE.md')) + + # ./.github/PULL_REQUEST_TEMPLATE + def test_pr_template(self): + self.assertEqual(True, os.path.isfile('./.github/PULL_REQUEST_TEMPLATE')) + + # ./README.md + def test_readme(self): + self.assertEqual(True, os.path.isfile('./README.md')) + + # ./TROUBLESHOOTING.md + def test_troubleshooting(self): + self.assertEqual(True, os.path.isfile('./TROUBLESHOOTING.md')) + + # ./USAGE.md + def test_usage(self): + self.assertEqual(True, os.path.isfile('./USAGE.md')) + + # ./USE_CASES.md + def test_use_cases(self): + self.assertEqual(True, os.path.isfile('./USE_CASES.md')) + +if __name__ == '__main__': +unittest.main() \ No newline at end of file From ea3d1251272dd94d8d35351e394c8383ece654e4 Mon Sep 17 00:00:00 2001 From: Matt Bernier Date: Thu, 2 Nov 2017 12:08:50 -0700 Subject: [PATCH 2/2] I put two wrong names in the issue - fixed --- test/test_files.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/test_files.py b/test/test_files.py index e99b4da..6316e0a 100644 --- a/test/test_files.py +++ b/test/test_files.py @@ -9,7 +9,7 @@ class ProjectTests(unittest.TestCase): # ./Docker or docker/Docker def test_docker_dir(self): - self.assertEqual(True, os.path.isdir("./Docker")) + self.assertEqual(True, os.path.isdir("./Dockerfile")) # ./docker-compose.yml or ./docker/docker-compose.yml def test_docker_compose(self): @@ -49,7 +49,7 @@ def test_issue_template(self): # ./LICENSE.md def test_license(self): - self.assertEqual(True, os.path.isfile('./LICENSE.md')) + self.assertEqual(True, os.path.isfile('./LICENSE.txt')) # ./.github/PULL_REQUEST_TEMPLATE def test_pr_template(self): @@ -72,4 +72,4 @@ def test_use_cases(self): self.assertEqual(True, os.path.isfile('./USE_CASES.md')) if __name__ == '__main__': -unittest.main() \ No newline at end of file +unittest.main()