Exemplo n.º 1
0
def main(config_file, skills_dir, language, repo_url,
         **kwargs):  # pragma: no cover
    """An open-source 🤖 assistant library built for people and made to be super
    easy to setup and understand.
    """
    if os.path.isfile(config_file):
        CONFIG.load_from_file(config_file)

    # Sets default settings value if not given in args or config file
    CONFIG.set(LANGUAGE, language or CONFIG.get(LANGUAGE, 'en'))
    CONFIG.set(SKILLS_DIR, skills_dir or CONFIG.get(SKILLS_DIR, os.getcwd()))
    CONFIG.set(REPO_URL, repo_url
               or CONFIG.get(REPO_URL, 'https://github.com/'))

    install_logs(CONFIG.get(VERBOSE), CONFIG.get(DEBUG))
Exemplo n.º 2
0
    def test_it_should_allow_load_resources(self):
        CONFIG.set(SETTING_ALLOWED_LANGUAGES, ['en', 'it'])

        expect(should_load_resources('en')).to.be.true
        expect(should_load_resources('it')).to.be.true
        expect(should_load_resources('fr')).to.be.false
Exemplo n.º 3
0
 def teardown(self):
     # Restore the global loading settings
     CONFIG.set(SETTING_ALLOWED_LANGUAGES, [])
Exemplo n.º 4
0
 def test_it_should_allow_load_resources_when_empty(self):
     CONFIG.set(SETTING_ALLOWED_LANGUAGES, [])
     expect(should_load_resources('fr')).to.be.true
Exemplo n.º 5
0
def setup_module(module):
  global agent
  remove_test_tmp_folder()
  test_tmp_folder_path = get_test_tmp_folder_path()
  CONFIG.set('path',test_tmp_folder_path,section='pytlas_list')
  agent = create_skill_agent(os.path.dirname(__file__), lang='en')