JSON fix; test file templating.
This commit is contained in:
parent
752f59fbf3
commit
c62f6e0589
|
@ -8,5 +8,5 @@
|
|||
"travis_ci_username": "audreyr",
|
||||
"release_date": "2013-07-10",
|
||||
"year": "2013",
|
||||
"version": "0.1.1",
|
||||
}
|
||||
"version": "0.1.1"
|
||||
}
|
||||
|
|
|
@ -1,47 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
test_complexity
|
||||
------------
|
||||
|
||||
Tests for `complexity` module.
|
||||
"""
|
||||
|
||||
import os
|
||||
import shutil
|
||||
import unittest
|
||||
|
||||
from complexity import complexity
|
||||
|
||||
|
||||
class TestComplexity(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
# os.chdir('tests/')
|
||||
os.mkdir('output/')
|
||||
|
||||
def test_make_sure_path_exists(self):
|
||||
self.assertTrue(complexity.make_sure_path_exists('/usr/'))
|
||||
self.assertFalse(
|
||||
complexity.make_sure_path_exists(
|
||||
'/this-dir-does-not-exist-and-cant-be-created/'
|
||||
)
|
||||
)
|
||||
|
||||
def test_generate_html(self):
|
||||
complexity.generate_html(['index', 'about'], context=None, input_dir='tests/input')
|
||||
self.assertTrue(os.path.isfile('output/index.html'))
|
||||
self.assertTrue(os.path.isfile('output/about/index.html'))
|
||||
|
||||
def test_generate_context(self):
|
||||
context = complexity.generate_context(input_dir='tests/input')
|
||||
self.assertEqual(context, {"test": {"1": 2}})
|
||||
|
||||
|
||||
|
||||
def tearDown(self):
|
||||
shutil.rmtree('output/')
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
|
@ -0,0 +1,30 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
test_{{ project.repo_name }}
|
||||
------------
|
||||
|
||||
Tests for `{{ project.repo_name }}` module.
|
||||
"""
|
||||
|
||||
import os
|
||||
import shutil
|
||||
import unittest
|
||||
|
||||
from {{ project.repo_name }} import {{ project.repo_name }}
|
||||
|
||||
|
||||
class TestComplexity(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
def test_something(self):
|
||||
pass
|
||||
|
||||
def tearDown(self):
|
||||
pass
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
Loading…
Reference in New Issue