class TestUser(TestCase): def setUp(self): self.user = User('foo', 'bar') def test_set_user(self): self.user.set_user() self.assertEqual('foo', self.user.user_name) def test_set_pwd(self): self.user.set_pwd() self.assertEqual('bar', self.user.user_pwd)
def main(): """ Main entry point for the FunPDBe client :return: None """ logger = FunPDBeClientLogger(name="main", write_mode="w") try: opts, args = getopt.getopt(sys.argv[1:], "u:p:m:i:r:f:a:oh", [ "user="******"pwd=", "mode=", "pdb_id=", "resource=", "path=", "api=", "overwrite", "help" ]) except getopt.GetoptError as err: generic_error() logger.log().error(err) sys.exit(2) schema = Schema() user = User() client = Client(schema, user) if opts: Control(opts, client=client).run() else: Control([('--help', '')], client=client).run()
def initialize_user(self): """ Create User() instance based on user name and password :return: new User() """ return User(user=self.user, pwd=self.pwd)
class TestUser(TestCase): def setUp(self): self.user = User('foo', 'bar') def test_set_user(self): self.user.set_user() self.assertEqual('foo', self.user.user_name) def test_set_pwd(self): self.user.set_pwd() self.assertEqual('bar', self.user.user_pwd) def test_set_attribute(self): with patch('builtins.input', side_effect='f'): new_value = self.user.set_attribute(None, 'user prompt message') self.assertEqual('f', new_value)
def setUp(self): self.user = User('foo', 'bar')