<commit_before>import unittest
import warnings
from datetime import datetime

import gw2api


class TestApi(unittest.TestCase):
    def setUp(self):
        super(TestApi, self).setUp()

    def test_map(self):
        map_names = gw2api.continents()
        self.assertIsInstance(map_names, dict)
        keys = ["continent_dims", "floors", "max_zoom", "min_zoom", "name"]
        for continent_id, continent in map_names.iteritems():
            self.assertEqual(sorted(continent.keys()), keys)

        map_names = gw2api.map_names()
        self.assertIsInstance(map_names, dict)
        key, value = map_names.items()[0]
        self.assertIsInstance(key, basestring)
        self.assertIsInstance(value, basestring)

        maps = gw2api.maps()
        self.assertIsInstance(maps, dict)
        key, value = maps.items()[0]
        self.assertIsInstance(key, basestring)
        self.assertIsInstance(value, dict)

        map_data = gw2api.maps(map_id=50)
        self.assertIsInstance(map_data, dict)
        self.assertEqual(map_data["map_name"], "Lion's Arch")

        # Floor 34 in Tyria contains Sanctum Sprint
        map_floor_data = gw2api.map_floor(1, 34)
        self.assertEqual(sorted(map_floor_data.keys()),
                         ["clamped_view", "regions", "texture_dims"])

    def test_misc(self):
        build = gw2api.build()
        self.assertIsInstance(build, int)

        colors = gw2api.colors()
        self.assertIsInstance(colors, dict)
        key, value = colors.items()[0]
        self.assertIsInstance(key, basestring)
        self.assertIsInstance(value, dict)
        self.assertEqual(sorted(value.keys()),
                         ["base_rgb", "cloth", "leather", "metal", "name"])
        self.assertEqual(sorted(value["cloth"].keys()),
                         ["brightness", "contrast", "hue", "lightness", "rgb",
                          "saturation"])

        files = gw2api.files()
        self.assertIsInstance(files, dict)
        key, value = files.items()[0]
        self.assertIsInstance(key, basestring)
        self.assertIsInstance(value, dict)
        self.assertEqual(sorted(value.keys()), ["file_id", "signature"])

    def test_skins(self):
        skins = gw2api.skins()
        self.assertIsInstance(skins, list)
        self.assertIsInstance(skins[0], int)
<commit_msg>update test for v1/colors endpoint<commit_after>import unittest
import warnings
from datetime import datetime

import gw2api


class TestApi(unittest.TestCase):
    def setUp(self):
        super(TestApi, self).setUp()

    def test_map(self):
        map_names = gw2api.continents()
        self.assertIsInstance(map_names, dict)
        keys = ["continent_dims", "floors", "max_zoom", "min_zoom", "name"]
        for continent_id, continent in map_names.iteritems():
            self.assertEqual(sorted(continent.keys()), keys)

        map_names = gw2api.map_names()
        self.assertIsInstance(map_names, dict)
        key, value = map_names.items()[0]
        self.assertIsInstance(key, basestring)
        self.assertIsInstance(value, basestring)

        maps = gw2api.maps()
        self.assertIsInstance(maps, dict)
        key, value = maps.items()[0]
        self.assertIsInstance(key, basestring)
        self.assertIsInstance(value, dict)

        map_data = gw2api.maps(map_id=50)
        self.assertIsInstance(map_data, dict)
        self.assertEqual(map_data["map_name"], "Lion's Arch")

        # Floor 34 in Tyria contains Sanctum Sprint
        map_floor_data = gw2api.map_floor(1, 34)
        self.assertEqual(sorted(map_floor_data.keys()),
                         ["clamped_view", "regions", "texture_dims"])

    def test_misc(self):
        build = gw2api.build()
        self.assertIsInstance(build, int)

        colors = gw2api.colors()
        self.assertIsInstance(colors, dict)
        key, value = colors.items()[0]
        self.assertIsInstance(key, basestring)
        self.assertIsInstance(value, dict)
        self.assertEqual(sorted(value.keys()),
                         ["base_rgb", "categories", "cloth", "item",
                          "leather", "metal", "name"])
        self.assertEqual(sorted(value["cloth"].keys()),
                         ["brightness", "contrast", "hue", "lightness", "rgb",
                          "saturation"])

        files = gw2api.files()
        self.assertIsInstance(files, dict)
        key, value = files.items()[0]
        self.assertIsInstance(key, basestring)
        self.assertIsInstance(value, dict)
        self.assertEqual(sorted(value.keys()), ["file_id", "signature"])

    def test_skins(self):
        skins = gw2api.skins()
        self.assertIsInstance(skins, list)
        self.assertIsInstance(skins[0], int)

{'fraction_non_alphanumeric': 0.12618495892142406, 'fraction_numerical': 0.009479671371392459, 'mean_word_length': 2.6024279210925645, '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': '5169764', 'n_tokens_mistral': 1487, 'n_tokens_neox': 1422, 'n_words': 266}