This repository has been archived by the owner on Jun 7, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
109 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
language: python | ||
python: | ||
- "2.7" | ||
- "3.2" | ||
- "3.3" | ||
- "3.4" | ||
before_install: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# -*- coding: utf8 -*- | ||
import sys | ||
|
||
|
||
def is_python3(): | ||
return sys.version_info[0] == 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
import unittest | ||
#from test import test_support | ||
from AvivoreXT import Compat, AvivoreConfig | ||
|
||
if Compat.is_python3(): | ||
from configparser import ConfigParser | ||
else: | ||
from ConfigParser import ConfigParser | ||
|
||
|
||
class AvivoreConfigTestCase(unittest.TestCase): | ||
# def setUp(self): | ||
# # code to execute in preparation for tests | ||
# pass | ||
# | ||
# def tearDown(self): | ||
# # code to execute to clean up after tests | ||
# pass | ||
def test_init(self): | ||
config_files = [ | ||
'testdata/test.conf', | ||
'testdata/test.db', | ||
'invalidpath/invalidfile', | ||
] | ||
|
||
for i in range(0, 10, 1): | ||
for j in range(0, len(config_files), 1): | ||
avivore_conf_inst = AvivoreConfig.AvivoreConfig(i, config_files[j]) | ||
self.assertTrue(avivore_conf_inst.config_type == i) | ||
self.assertTrue(avivore_conf_inst.config_filename == config_files[j]) | ||
self.assertTrue(isinstance(avivore_conf_inst.config, ConfigParser)) | ||
self.assertTrue(avivore_conf_inst.twitter_search_types == []) | ||
self.assertTrue(avivore_conf_inst.twitter_search_terms == []) | ||
self.assertTrue(avivore_conf_inst.twitter_track_keywords is None) | ||
self.assertTrue(avivore_conf_inst.twitter_consumer_key is None) | ||
self.assertTrue(avivore_conf_inst.twitter_consumer_secret is None) | ||
self.assertTrue(avivore_conf_inst.twitter_search_interval == 30) | ||
self.assertTrue(avivore_conf_inst.credentials_file is None) | ||
self.assertTrue(avivore_conf_inst.database_path is None) | ||
|
||
def test_read_config(self): | ||
pass | ||
|
||
def test_init_config_database(self): | ||
pass | ||
|
||
def test_init_database(self): | ||
pass | ||
|
||
|
||
def test_main(): | ||
#test_support.run_unittest(AvivoreConfigTestCase) | ||
#suite = unittest.defaultTestLoader.loadTestsFromTestCase(AvivoreConfigTestCase) | ||
#unittest.TextTestRunner().run(suite) | ||
#unittest.main() | ||
|
||
suite = unittest.TestSuite() | ||
loader = unittest.TestLoader() | ||
tcl = loader.loadTestsFromTestCase | ||
|
||
testClasses = [ | ||
'AvivoreConfigTestCase' | ||
] | ||
|
||
for c in testClasses: | ||
suite.addTest(tcl(c)) | ||
|
||
unittest.TextTestRunner(verbosity=2).run(suite) | ||
|
||
if __name__ == '__main__': | ||
test_main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters