<commit_before>from tests.test_actions import *
from ltk import actions, exceptions
import unittest

class TestInitAction(unittest.TestCase):

    def test_uninitialized(self):
        # todo create dir outside so folder not initialized
        self.assertRaises(exceptions.UninitializedError, actions.Action, os.getcwd())

    def test_init_host(self):
        create_config()
        action = actions.Action(os.getcwd())
        assert action.host
        cleanup()

    def test_init_access_token(self):
        create_config()
        action = actions.Action(os.getcwd())
        assert action.access_token
        cleanup()

    def test_init_project_id(self):
        create_config()
        action = actions.Action(os.getcwd())
        assert action.project_id
        cleanup()

    def test_init_path(self):
        create_config()
        action = actions.Action(os.getcwd())
        assert action.path
        cleanup()

    def test_init_community_id(self):
        create_config()
        action = actions.Action(os.getcwd())
        assert action.community_id
        cleanup()

    def test_init_api(self):
        create_config()
        action = actions.Action(os.getcwd())
        assert action.api
        cleanup()

    def test_init_doc_manager(self):
        create_config()
        action = actions.Action(os.getcwd())
        assert action.doc_manager
        cleanup()

# if __name__ == '__main__':
#     unittest.main()<commit_msg>Change directory to test uninitialized project<commit_after>from tests.test_actions import *
from ltk import actions, exceptions
import unittest

class TestInitAction(unittest.TestCase):

    def test_uninitialized(self):
        # todo create dir outside so folder not initialized
        os.chdir('/')
        self.assertRaises(exceptions.UninitializedError, actions.Action, os.getcwd())

    def test_init_host(self):
        create_config()
        action = actions.Action(os.getcwd())
        assert action.host
        cleanup()

    def test_init_access_token(self):
        create_config()
        action = actions.Action(os.getcwd())
        assert action.access_token
        cleanup()

    def test_init_project_id(self):
        create_config()
        action = actions.Action(os.getcwd())
        assert action.project_id
        cleanup()

    def test_init_path(self):
        create_config()
        action = actions.Action(os.getcwd())
        assert action.path
        cleanup()

    def test_init_community_id(self):
        create_config()
        action = actions.Action(os.getcwd())
        assert action.community_id
        cleanup()

    def test_init_api(self):
        create_config()
        action = actions.Action(os.getcwd())
        assert action.api
        cleanup()

    def test_init_doc_manager(self):
        create_config()
        action = actions.Action(os.getcwd())
        assert action.doc_manager
        cleanup()

if __name__ == '__main__':
    unittest.main()
{'fraction_non_alphanumeric': 0.09510961214165262, 'fraction_numerical': 0.0, 'mean_word_length': 2.5520958083832337, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3605708', 'n_tokens_mistral': 853, 'n_tokens_neox': 837, 'n_words': 175}