<commit_before><commit_msg>Wrap transfer of blobs in testcases<commit_after>import pygit2
from groundstation.utils import oid2hex
from handler_fixture import StationHandlerTestCase

from groundstation.proto.git_object_pb2 import GitObject

from groundstation.transfer.response_handlers import handle_transfer


class TestHandlerTransfer(StationHandlerTestCase):
    def test_transfer_object(self):
        object_body = "foo bar baz butts lol"
        oid = pygit2.hash(object_body)
        git_pb = GitObject()
        git_pb.data = object_body
        git_pb.type = pygit2.GIT_OBJ_BLOB
        self.station.payload = git_pb.SerializeToString()
        handle_transfer(self.station)

        self.assertTrue(self.station.station[oid2hex(oid)], object_body)
{'fraction_non_alphanumeric': 0.06737120211360634, 'fraction_numerical': 0.007926023778071334, 'mean_word_length': 4.375886524822695, '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': '6620382', 'n_tokens_mistral': 223, 'n_tokens_neox': 219, 'n_words': 46}