'Test is torrent or nzb file'

def test_is_torrent_or_nzb_file(self):

    test_cases = {None: False, 42: False, u'': False, u'filename': False, u'.nzb': True, u'file.nzb': True, u'file.nzb.part': False, u'.torrent': True, u'file.torrent': True, u'file.torrent.part': False}
    unicode_test_cases = {u'': False, u'filename': False, u'.nzb': True, u'file.nzb': True, u'file.nzb.part': False, u'.torrent': True, u'file.torrent': True, u'file.torrent.part': False}
    for tests in (test_cases, unicode_test_cases):
        for (filename, result) in six.iteritems(tests):
            self.assertEqual(is_torrent_or_nzb_file(filename), result)
