<commit_before>#!/usr/bin/env python3
"""
Tests to validate redis list functionality is working properly with micropython
"""
# Notes:
#
# 1. These tests should be run with a cpython interpreter with the redislite module installed.
# 2. The micropython executable should be accesible in the path.
import redislite
from unittest import main, TestCase
import redis
import uredis


class TestRedisListOperations(TestCase):
    redis_test_port = 7899

    def setUp(self):
        self.redis_server = redislite.Redis(serverconfig={'port': self.redis_test_port})

    def tearDown(self):
        self.redis_server.shutdown()

    def test_lrange_empty_list(self):
        result = redis.Redis(port=self.redis_test_port).lrange("testlist", 0, -1)
        uresult = uredis.Redis(host='127.0.0.1', port=self.redis_test_port).lrange("utestlist", 0, -1)
        self.assertEqual(uresult, result)

    def test_blpop_empty_list_with_timeout(self):
        result = redis.Redis(port=self.redis_test_port).blpop('testlist', timeout=1)
        uresult = uredis.Redis(host='127.0.0.1', port=self.redis_test_port).blpop('utestlist', timeout=1)
        self.assertEqual(uresult, result)


    def test_lpush_new_list_integer_value(self):
        result = redis.Redis(port=self.redis_test_port).lpush('testlist', 1)
        uresult = uredis.Redis(host='127.0.0.1', port=self.redis_test_port).lpush('utestlist', 1)
        self.assertEqual(uresult, result)


if __name__ == '__main__':
    main()<commit_msg>Use an ipv4 address<commit_after>#!/usr/bin/env python3
"""
Tests to validate redis list functionality is working properly with micropython
"""
# Notes:
#
# 1. These tests should be run with a cpython interpreter with the redislite module installed.
# 2. The micropython executable should be accesible in the path.
import redislite
from unittest import main, TestCase
import redis
import uredis


class TestRedisListOperations(TestCase):
    redis_test_port = 7899

    def setUp(self):
        self.redis_server = redislite.Redis(serverconfig={'port': self.redis_test_port})

    def tearDown(self):
        self.redis_server.shutdown()

    def test_lrange_empty_list(self):
        result = redis.Redis(host='127.0.0.1', port=self.redis_test_port).lrange("testlist", 0, -1)
        uresult = uredis.Redis(host='127.0.0.1', port=self.redis_test_port).lrange("utestlist", 0, -1)
        self.assertEqual(uresult, result)

    def test_blpop_empty_list_with_timeout(self):
        result = redis.Redis(host='127.0.0.1', port=self.redis_test_port).blpop('testlist', timeout=1)
        uresult = uredis.Redis(host='127.0.0.1', port=self.redis_test_port).blpop('utestlist', timeout=1)
        self.assertEqual(uresult, result)


    def test_lpush_new_list_integer_value(self):
        result = redis.Redis(host='127.0.0.1', port=self.redis_test_port).lpush('testlist', 1)
        uresult = uredis.Redis(host='127.0.0.1', port=self.redis_test_port).lpush('utestlist', 1)
        self.assertEqual(uresult, result)


if __name__ == '__main__':
    main()
{'fraction_non_alphanumeric': 0.12343647136273865, 'fraction_numerical': 0.027978933508887426, 'mean_word_length': 4.186006825938566, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 9, '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': '7125706', 'n_tokens_mistral': 1114, 'n_tokens_neox': 1053, 'n_words': 207}