def test_gets_plugins_when_database_blocked(self, database: Database) -> None: """Test get plug-ins when database is blocked.""" database._database_blocked.value = True result: Optional[List] = database.get_plugins() assert not result
def test_gets_plugins_when_database_unblocked_and_plugins_exists( self, database: Database) -> None: """Test get existing plug-ins.""" database._database_blocked.value = False expected: List[str] = [ "Hildegunst von Mythenmetz", "Rumo von Zamonien" ] result: Optional[List] = database.get_plugins() assert type(result) is list assert Counter(result) == Counter(expected)
def test_gets_plugins_when_database_unblocked_and_no_plugins_exists( self, database: Database) -> None: """Test get not existing plug-ins.""" database._database_blocked.value = False result: Optional[List] = database.get_plugins() global mocked_pool_cur mocked_pool_cur.execute.assert_called_once_with( ("SELECT name FROM meta_plugins;"), None) assert type(result) is list assert result == [] reset_mocked_pool_cursor()