#!/usr/bin/env python
# -*- coding: utf-8 -*-

import unittest

class TestUpstream(unittest.TestCase):
    def setUp(self):
        pass

    def tearDown(self):
        pass


@@ -51,126 +51,1657 @@
 ort 
-unittest%0A%0Aclass TestUpstream(unittest.TestCase):%0A    def setUp(self):%0A        pass%0A%0A    def tearDown(self):%0A        pass%0A%0A
+json%0Aimport unittest%0A%0Afrom upstream.chunk import Chunk%0A%0A%0Aclass TestChunk(unittest.TestCase):%0A    def setUp(self):%0A        # Some values%0A        filehash = (%225547a152337de9ff6a97f6f099bb024e%22%0A                    %2208af419cee613b18da76a33e581d49ac%22)%0A        decryptkey = (%222b77e64156f9f7eb16d74b98f70417e4%22%0A                      %22d665d977d0ef00e793d41767acf13e8c%22)%0A%0A        # Create empty object%0A        empty_chunk = Chunk()%0A        # Create half object%0A        half_chunk = Chunk(filehash)%0A        # Create full object%0A        full_chunk = Chunk(filehash, decryptkey)%0A%0A        # Run getters%0A        self._run_gets(empty_chunk)%0A        self._run_gets(half_chunk)%0A        self._run_gets(full_chunk)%0A%0A        # Create new objects%0A        self.chunk1 = Chunk()%0A        self.chunk2 = Chunk()%0A%0A        # Load content%0A        json_dict = %7B%0A            %22key%22: %222b77e64156f9f7eb16d74b98f70417e4%22%0A                   %22d665d977d0ef00e793d41767acf13e8c%22,%0A            %22filehash%22: %225547a152337de9ff6a97f6f099bb024e%22%0A                        %2208af419cee613b18da76a33e581d49ac%22%0A        %7D%0A%0A        self.chunk1.load_json(json.dumps(json_dict))%0A        raw_uri = (%225547a152337de9ff6a97f6f099bb024e08af419cee613b18da76a33e5%22%0A                   %2281d49ac?key=2b77e64156f9f7eb16d74b98f70417e4d665d977d0ef0%22%0A                   %220e793d41767acf13e8c%22)%0A        self.chunk2.load_uri(raw_uri)%0A%0A    def tearDown(self):%0A        pass%0A%0A    def _run_gets(self, chunk):%0A        chunk.get_uri()%0A        chunk.get_tuple()%0A        chunk.get_json()%0A%0A    def test_chunks(self):%0A        # Fit everything into one test case%0A        self.assertEqual(self.chunk1.get_tuple(), self.chunk2.get_tuple())

Add unit tests