Exemple #1
0
 def test_get_template_by_name(self):
     template_1 = {'id': 1, 'name': 'first'}
     template_2 = {'id': 2, 'name': 'second'}
     template_set = [template_1, template_2]
     self.assertDictEqual(template_1, PortfolioManagerImport.get_template_by_name(template_set, 'first'))
     self.assertDictEqual(template_2, PortfolioManagerImport.get_template_by_name(template_set, 'second'))
     with self.assertRaises(Exception):
         PortfolioManagerImport.get_template_by_name(template_set, 'missing')
Exemple #2
0
 def test_unsuccessful_login(self):
     # To test a successful login, we'd have to include valid PM credentials, which we don't want to do
     # so I will at least test an unsuccessful login attempt here
     pmi = PortfolioManagerImport('bad_username', 'bad_password')
     with self.assertRaises(Exception):
         pmi.login_and_set_cookie_header()