def test_create_user(self): new_user = User("foo-user", "password") assert "foo-user" == new_user.user_name() new_user.create(self.connection) users = User.list(self.connection) assert "foo-user" in users new_user.delete(self.connection)
def test_save_user(self): user = User("foo-user", "password") assert user.create(self.connection).description() is None user.set_description("This is the foo user") user.update(self.connection) user = User.lookup(self.connection, "foo-user") assert "This is the foo user" == user.description() user.delete(self.connection)
def test_create_user(self): connection = Connection.make_connection(tc.hostname, tc.admin, tc.password) new_user = User("foo-user", "password") self.assertEqual(new_user.user_name(), "foo-user") new_user.create(connection) users = User.list(connection) self.assertIn("foo-user", users) new_user.delete(connection)
def test_save_user(self): connection = Connection.make_connection(tc.hostname, tc.admin, tc.password) user = User("foo-user", "password") self.assertIsNone(user.create(connection).description()) user.set_description("This is the foo user") user.update(connection) user = User.lookup(connection, "foo-user") self.assertEqual("This is the foo user", user.description()) user.delete(connection)