예제 #1
0
 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()
예제 #2
0
 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()
예제 #3
0
 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()
예제 #4
0
 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'
예제 #5
0
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)