<commit_before>import unittest
from six import iterkeys
from sentinel_s3.crawler import get_product_metadata_path


class Test(unittest.TestCase):

    def test_get_product_metadata_path(self):

        v = get_product_metadata_path(2015, 9, 2)

        keys = list(iterkeys(v))
        assert len(keys) == 14
        assert 'tiles' in v[keys[0]]
        assert 'metadata' in v[keys[0]]

        metadata = v[keys[0]]['metadata'].split('/')<commit_msg>test for single product metadata path<commit_after>import unittest
from six import iterkeys
from sentinel_s3.crawler import get_product_metadata_path, get_products_metadata_path


class Test(unittest.TestCase):

    def test_get_product_metadata_path(self):

        product = 'S2A_OPER_PRD_MSIL1C_PDMC_20160311T194734_R031_V20160311T011614_20160311T011614'
        v = get_product_metadata_path(product)

        keys = list(iterkeys(v))
        assert len(keys) == 1
        assert 'tiles' in v[keys[0]]
        assert 'metadata' in v[keys[0]]
        assert keys[0] == product

        metadata = v[keys[0]]['metadata'].split('/')
        tiles = v[keys[0]]['tiles'][0].split('/')

        assert metadata[-1] == 'metadata.xml'
        assert tiles[-1] == 'tileInfo.json'
        assert len(v[product]['tiles']) == 2

    def test_get_products_metadata_path(self):

        v = get_products_metadata_path(2015, 9, 2)

        keys = list(iterkeys(v))
        assert len(keys) == 14
        assert 'tiles' in v[keys[0]]
        assert 'metadata' in v[keys[0]]

        metadata = v[keys[0]]['metadata'].split('/')
{'fraction_non_alphanumeric': 0.12571793235481812, 'fraction_numerical': 0.05169112954690491, 'mean_word_length': 3.343490304709141, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 1}, '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': '5072236', 'n_tokens_mistral': 568, 'n_tokens_neox': 509, 'n_words': 106}