# Testing an Abelian Group of in C

from Group import Group
import random

# Global variables
g = Group()
a = random.sample(g.elements, 1)[0]
b = random.sample(g.elements, 1)[0]
c = random.sample(g.elements, 1)[0]

@classmethod
def setup_class(): pass

def test_closure():
    assert a * b in g

def test_associativity():
    assert a * (b * c) == (a * b) * c

def test_identity():
    assert a * g.identity == a

def test_inverse():
    def myInv(x):
        return x**-1
    g.inv = myInv
    assert a * g.inv(a) == g.identity

#Only an Abelian Group must be commutative
def test_commutativity():
    assert a + b == b + a



9166c3f1ceb6bfdce665b04acc82e4e0ce0811d2
<mask token>


def test_closure():
    assert a * b in g


def test_associativity():
    assert a * (b * c) == a * b * c


def test_identity():
    assert a * g.identity == a


def test_inverse():

    def myInv(x):
        return x ** -1
    g.inv = myInv
    assert a * g.inv(a) == g.identity


def test_commutativity():
    assert a + b == b + a

<mask token>


@classmethod
def setup_class():
    pass


def test_closure():
    assert a * b in g


def test_associativity():
    assert a * (b * c) == a * b * c


def test_identity():
    assert a * g.identity == a


def test_inverse():

    def myInv(x):
        return x ** -1
    g.inv = myInv
    assert a * g.inv(a) == g.identity


def test_commutativity():
    assert a + b == b + a

<mask token>
g = Group()
a = random.sample(g.elements, 1)[0]
b = random.sample(g.elements, 1)[0]
c = random.sample(g.elements, 1)[0]


@classmethod
def setup_class():
    pass


def test_closure():
    assert a * b in g


def test_associativity():
    assert a * (b * c) == a * b * c


def test_identity():
    assert a * g.identity == a


def test_inverse():

    def myInv(x):
        return x ** -1
    g.inv = myInv
    assert a * g.inv(a) == g.identity


def test_commutativity():
    assert a + b == b + a

from Group import Group
import random
g = Group()
a = random.sample(g.elements, 1)[0]
b = random.sample(g.elements, 1)[0]
c = random.sample(g.elements, 1)[0]


@classmethod
def setup_class():
    pass


def test_closure():
    assert a * b in g


def test_associativity():
    assert a * (b * c) == a * b * c


def test_identity():
    assert a * g.identity == a


def test_inverse():

    def myInv(x):
        return x ** -1
    g.inv = myInv
    assert a * g.inv(a) == g.identity


def test_commutativity():
    assert a + b == b + a

# Testing an Abelian Group of in C

from Group import Group
import random

# Global variables
g = Group()
a = random.sample(g.elements, 1)[0]
b = random.sample(g.elements, 1)[0]
c = random.sample(g.elements, 1)[0]

@classmethod
def setup_class(): pass

def test_closure():
    assert a * b in g

def test_associativity():
    assert a * (b * c) == (a * b) * c

def test_identity():
    assert a * g.identity == a

def test_inverse():
    def myInv(x):
        return x**-1
    g.inv = myInv
    assert a * g.inv(a) == g.identity

#Only an Abelian Group must be commutative
def test_commutativity():
    assert a + b == b + a


