MCPcopy Create free account
hub / github.com/tiny-pilot/tinypilot / test_cannot_register_duplicate_users

Method test_cannot_register_duplicate_users

app/auth_test.py:46–52  ·  view source on GitHub ↗
(self, mock_get_db)

Source from the content-addressed store, hash-verified

44 @mock.patch.object(video_service, 'restart', do_nothing)
45 @mock.patch.object(db.users.db_connection, 'get')
46 def test_cannot_register_duplicate_users(self, mock_get_db):
47 with tempfile.NamedTemporaryFile() as temp_file:
48 mock_get_db.return_value = db.store.create_or_open(temp_file.name)
49
50 auth.register('pilot', '12345', auth.Role.ADMIN)
51 with self.assertRaises(db.users.UserAlreadyExistsError):
52 auth.register('pilot', 'p4ssw0rd', auth.Role.ADMIN)
53
54 @mock.patch.object(video_service, 'restart', do_nothing)
55 @mock.patch.object(db.users.db_connection, 'get')

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected