예제 #1
0
    def test_read(self, create_db_instance):
        """Test read is coherent from view and wrapped database."""
        database = create_db_instance
        readonly_database = ReadOnlyDB(database)

        args = {"collection_name": "trials", "query": {"experiment": "supernaedo2"}}
        readonly_result = readonly_database.read(**args)
        result = database.read(**args)

        assert len(result) > 0  # Otherwise the test is pointless
        assert readonly_result == result
예제 #2
0
    def test_read(self, hacked_exp):
        """Test read is coherent from view and wrapped database."""
        database = get_storage()._db
        readonly_database = ReadOnlyDB(database)

        args = {
            "collection_name": "experiments",
            "query": {
                "name": "supernaedo2-dendi"
            },
        }
        readonly_result = readonly_database.read(**args)
        result = database.read(**args)

        assert len(result) > 0  # Otherwise the test is pointless
        assert readonly_result == result