<commit_before>import tensorflow as tf
import hyperchamber as hc
import numpy as np
from hypergan.discriminators.pyramid_discriminator import PyramidDiscriminator
from hypergan.ops import TensorflowOps

from unittest.mock import MagicMock

from hypergan import GAN


graph = hc.Config({
    'x': tf.constant(1., shape=[32,32,32])
})


class MockOps:
    def __init__(self):
        self.mock = True

class GANTest(tf.test.TestCase):
    def test_constructor(self):
        with self.test_session():
            gan = GAN(graph = graph, ops = MockOps)
            self.assertEqual(gan.graph.x, graph.x)

    def test_train(self):
        with self.test_session():
            gan = GAN(graph = graph, ops = MockOps)<commit_msg>[fix] mock trainer<commit_after>import tensorflow as tf
import hyperchamber as hc
import numpy as np
from hypergan.discriminators.pyramid_discriminator import PyramidDiscriminator
from hypergan.ops import TensorflowOps

from unittest.mock import MagicMock

from hypergan import GAN


graph = hc.Config({
    'x': tf.constant(1., shape=[32,32,32])
})


class MockOps:
    def __init__(self):
        self.mock = True

class MockTrainer:
    def __init__(self):
        self.mock = True


class GANTest(tf.test.TestCase):
    def test_constructor(self):
        with self.test_session():
            gan = GAN(graph = graph, ops = MockOps)
            self.assertEqual(gan.graph.x, graph.x)

    def test_train(self):
        trainer = MockTrainer()
        config = {}
        config['trainer'] = trainer
        with self.test_session():
            gan = GAN(graph = graph, ops = MockOps, config = config)
{'fraction_non_alphanumeric': 0.09865196078431372, 'fraction_numerical': 0.00857843137254902, 'mean_word_length': 3.092731829573935, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4965587', 'n_tokens_mistral': 518, 'n_tokens_neox': 501, 'n_words': 136}