<commit_before>from collections import Hashable
from datetime import datetime
import os.path

from sunpy.database.tables import FitsHeaderEntry, Tag, DatabaseEntry
from sunpy.net.vso import VSOClient
import sunpy

import pytest


def test_fits_header_entry_equality():
    assert FitsHeaderEntry('key', 'value') == FitsHeaderEntry('key', 'value')
    assert not (FitsHeaderEntry('key', 'value') == FitsHeaderEntry('k', 'v'))


def test_fits_header_entry_inequality():
    assert FitsHeaderEntry('key', 'value') != FitsHeaderEntry('k', 'v')
    assert not (FitsHeaderEntry('k', 'v') != FitsHeaderEntry('k', 'v'))


def test_fits_header_entry_hashability():
    assert not isinstance(FitsHeaderEntry('key', 'value'), Hashable)


def test_tag_equality():
    assert Tag('abc') == Tag('abc')
    assert not (Tag('abc') == Tag('xyz'))


def test_tag_inequality():
    assert Tag('abc') != Tag('xyz')
    assert not (Tag('abc') != Tag('abc'))


def test_tag_hashability():
    assert not isinstance(Tag(''), Hashable)


def test_entry_from_qr_block():
    client = VSOClient()
    qr = client.query_legacy('2001/1/1', '2001/1/2', instrument='EIT')
    entry = DatabaseEntry.from_query_result_block(qr[0])
    expected_entry = DatabaseEntry(
        source='SOHO', provider='SDAC', physobs='intensity',
        fileid='/archive/soho/private/data/processed/eit/lz/2001/01/efz20010101.010014',
        observation_time_start=datetime(2001, 1, 1, 1, 0, 14),
        observation_time_end=datetime(2001, 1, 1, 1, 0, 21),<commit_msg>mark the slow test with pytest.mark so that it can be disabled via the -k option<commit_after>from collections import Hashable
from datetime import datetime
import os.path

from sunpy.database.tables import FitsHeaderEntry, Tag, DatabaseEntry
from sunpy.net.vso import VSOClient
import sunpy

import pytest


def test_fits_header_entry_equality():
    assert FitsHeaderEntry('key', 'value') == FitsHeaderEntry('key', 'value')
    assert not (FitsHeaderEntry('key', 'value') == FitsHeaderEntry('k', 'v'))


def test_fits_header_entry_inequality():
    assert FitsHeaderEntry('key', 'value') != FitsHeaderEntry('k', 'v')
    assert not (FitsHeaderEntry('k', 'v') != FitsHeaderEntry('k', 'v'))


def test_fits_header_entry_hashability():
    assert not isinstance(FitsHeaderEntry('key', 'value'), Hashable)


def test_tag_equality():
    assert Tag('abc') == Tag('abc')
    assert not (Tag('abc') == Tag('xyz'))


def test_tag_inequality():
    assert Tag('abc') != Tag('xyz')
    assert not (Tag('abc') != Tag('abc'))


def test_tag_hashability():
    assert not isinstance(Tag(''), Hashable)


@pytest.mark.slow
def test_entry_from_qr_block():
    client = VSOClient()
    qr = client.query_legacy('2001/1/1', '2001/1/2', instrument='EIT')
    entry = DatabaseEntry.from_query_result_block(qr[0])
    expected_entry = DatabaseEntry(
        source='SOHO', provider='SDAC', physobs='intensity',
        fileid='/archive/soho/private/data/processed/eit/lz/2001/01/efz20010101.010014',
        observation_time_start=datetime(2001, 1, 1, 1, 0, 14),
        observation_time_end=datetime(2001, 1, 1, 1, 0, 21),
{'fraction_non_alphanumeric': 0.15072, 'fraction_numerical': 0.03392, 'mean_word_length': 5.093567251461988, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '803375', 'n_tokens_mistral': 1125, 'n_tokens_neox': 1027, 'n_words': 233}