<commit_before># Copyright (C) 2015 <NAME> <<EMAIL>>

import pytest

from streamr.types import *

class TestPyTypes(object):
    class Base(object):
        pass
    class Sub(Base):
        pass
    
    @pytest.fixture
    def base(self):
        return PyType(TestPyTypes.Base)

    @pytest.fixture
    def sub(self):
        return PyType(TestPyTypes.Sub)

    def test_equality(self, base, sub):
        assert base == base
        assert sub == sub
        assert not (base == sub)
        assert not (sub == base)

    def test_lowerThan(self, base, sub):
        assert not (base < base)
        assert base <= base
        assert not (sub < sub)
        assert sub <= sub 
        assert base < sub
        assert base <= sub
        assert not (sub < base)
        assert not (sub <= base) 
 
    def test_greaterThan(self, base, sub):
        assert not (base > base)
        assert base >= base
        assert not (sub > sub)
        assert sub >= sub 
        assert not (base > sub)
        assert not (base >= sub)
        assert sub > base
        assert sub >= base<commit_msg>tests on ProductType<commit_after># Copyright (C) 2015 <NAME> <<EMAIL>>

import pytest

from streamr.types import *

class TestPyTypes(object):
    class Base(object):
        pass
    class Sub(Base):
        pass

    class Other(object):
        pass
    
    @pytest.fixture
    def base(self):
        return PyType.get(TestPyTypes.Base)

    @pytest.fixture
    def sub(self):
        return PyType.get(TestPyTypes.Sub)

    @pytest.fixture
    def other(self):
        return PyType.get(TestPyTypes.Other)

    def test_equality(self, base, sub):
        assert base == base
        assert sub == sub
        assert not (base == sub)
        assert not (sub == base)

    def test_lowerThan(self, base, sub):
        assert not (base < base)
        assert base <= base
        assert not (sub < sub)
        assert sub <= sub 
        assert base < sub
        assert base <= sub
        assert not (sub < base)
        assert not (sub <= base) 
 
    def test_greaterThan(self, base, sub):
        assert not (base > base)
        assert base >= base
        assert not (sub > sub)
        assert sub >= sub 
        assert not (base > sub)
        assert not (base >= sub)
        assert sub > base
        assert sub >= base

    def test_noRelationToOther(self, base, sub, other):
        assert not (base == other)
        assert base != other
        assert not (base <= other)
        assert not (base < other)
        assert not (base >= other)
        assert not (base > other)

class TestProductTypes(object):
    class Base(object):
        pass
    class Sub(Base):
        pass

    class Other(object):
        pass
    
    @pytest.fixture
    def base(self):
        return PyType.get(TestPyTypes.Base)

    @pytest.fixture
    def sub(self):
        return PyType.get(TestPyTypes.Sub)

    @pytest.fixture
    def other(self):
        return PyType.get(TestPyTypes.Other)

    def test_comparison1(self, base, sub):
        t1 = ProductType.get(base, base)
        t2 = ProductType.get(base, base)

        assert t1 == t2
        assert t1 <= t2
        assert t1 >= t2
        assert t2 <= t1
        assert t2 >= t2
        assert not (t1 < t2)
        assert not (t1 > t2)
        assert not (t2 < t1)
        assert not (t2 > t1)
        assert not (t2 != t1)

    def test_comparison2(self, base, sub):
        t1 = ProductType.get(base, sub)
        t2 = ProductType.get(base, base)

        assert t1 != t2
        assert not (t1 == t2)
        assert t2 != t1
        assert not (t2 == t1)
        assert t1 >= t2
        assert t1 > t2
        assert not (t1 <= t2)
        assert not (t1 < t2)
        assert not (t2 >= t1)
        assert not (t2 > t1)
        assert t2 <= t1
        assert t2 < t1

    def test_comparison3(self, base, sub):
        t1 = ProductType.get(sub, sub)
        t2 = ProductType.get(base, base)

        assert t1 != t2
        assert not (t1 == t2)
        assert t2 != t1
        assert not (t2 == t1)
        assert t1 >= t2
        assert t1 > t2
        assert not (t1 <= t2)
        assert not (t1 < t2)
        assert not (t2 >= t1)
        assert not (t2 > t1)
        assert t2 <= t1
        assert t2 < t1

    def test_comparison4(self, base, other):
        t1 = ProductType.get(base, other)
        t2 = ProductType.get(base, base)

        assert t1 != t2
        assert not (t1 == t2)
        assert t2 != t1
        assert not (t2 == t1)
        assert not (t1 >= t2)
        assert not (t1 > t2)
        assert not (t1 <= t2)
        assert not (t1 < t2)
        assert not (t2 >= t1)
        assert not (t2 > t1)
        assert not (t2 <= t1)
        assert not (t2 < t1)
{'fraction_non_alphanumeric': 0.10130581297388375, 'fraction_numerical': 0.02358887952822241, 'mean_word_length': 1.7230504587155964, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 0, '>': 43, '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': '1518902', 'n_tokens_mistral': 1530, 'n_tokens_neox': 1497, 'n_words': 490}