<commit_before>import unittest
import sys

from solvebio import Annotation

class AnnotationTest(unittest.TestCase):

    def test_annotation(self):
        self.assertEqual(Annotation.class_url(), '/v1/annotations',
                         'Annotation.class_url()')

        expect = [
            ('class_name', 'Annotation'),
            ('created_at', '2014-09-11T22:01:16.184Z'),
            # ('download_url',
            #  'https://api.solvebio.com/v1/annotations/1/download'),
            ('id'          , 1),
            ('sample_id'   , 1),
            ('status'      , 'completed')
            ]
        a = Annotation.retrieve(1)
        subset = [(key, a[key]) for
                  key in [x[0] for x in expect]]
        self.assertEqual(subset, expect, 'Annotation.retrieve(1)')

        all = Annotation.all()
        self.assertTrue(len(all) > 1,
                        "Annotation.all() returns more than one value")


if __name__ == "__main__":
    unittest.main()<commit_msg>This time, for sure! Need to try with something test key has access to. And while we are at it we should also test access denied.<commit_after>import unittest
import sys

from solvebio import Annotation

class AnnotationTest(unittest.TestCase):

    def test_annotation(self):
        self.assertEqual(Annotation.class_url(), '/v1/annotations',
                         'Annotation.class_url()')

        # FIXME:
        # Hmmm, need to try with something test key has access to.
        # And while we are at it we should also test access denied.
        # expect = [
        #     ('class_name', 'Annotation'),
        #     ('created_at', '2014-09-11T22:01:16.184Z'),
        #     # ('download_url',
        #     #  'https://api.solvebio.com/v1/annotations/1/download'),
        #     ('id'          , 1),
        #     ('sample_id'   , 1),
        #     ('status'      , 'completed')
        #     ]
        # a = Annotation.retrieve(1)
        # subset = [(key, a[key]) for
        #           key in [x[0] for x in expect]]
        # self.assertEqual(subset, expect, 'Annotation.retrieve(1)')

        all = Annotation.all()
        self.assertTrue(len(all) > 1,
                        "Annotation.all() returns more than one value")


if __name__ == "__main__":
    unittest.main()
{'fraction_non_alphanumeric': 0.13187772925764193, 'fraction_numerical': 0.022707423580786028, 'mean_word_length': 1.9221938775510203, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '224663', 'n_tokens_mistral': 701, 'n_tokens_neox': 661, 'n_words': 164}