def test_installer(self): connector = Connector(config_file_name=self.config_file_name) Installer(connector=connector, overwrite=True) i = Installer(connector=connector, overwrite=False) i.user_manager.sign_in('administrator', 'admin') self.assertTrue(i.check_if_user_is_administrator()) self.assertTrue(i.user_manager.check_if_user_is_administrator()) self.assertTrue(i.signed_in()) self.assertTrue(i.user_manager.signed_in()) i.user_manager.sign_out()
def setUp(self): self.config_file_name = 'tests/config.ini' self.connector = Connector(config_file_name=self.config_file_name) Installer(connector=self.connector, overwrite=True) self.client = Client(connector=self.connector) self.client.user_manager.sign_in('administrator', 'admin') self.test_user = self.client.user_manager.create_user('jack', 'pass', '*****@*****.**', 'Jack', 'Black') self.test_user2 = self.client.user_manager.create_user('jessy', 'pass', '*****@*****.**', 'Jessy', 'Kriek') self.client.user_manager.sign_out()
def test_client(self): connector = Connector(config_file_name=self.config_file_name) Installer(connector=connector, overwrite=True) cl = Client(connector=connector) cl.user_manager.user = None cl.user_manager._generate_session_data() with self.assertRaises(ValueError): cl.user = '******' with self.assertRaises(ValueError): cl.session_data = 'session data' with self.assertRaises(ValueError): cl.project = 'project'
from __future__ import division, print_function from BDProjects.Client import Connector, Installer connector = Connector(config_file_name='config.ini') installer = Installer(connector=connector, overwrite=True)