# encoding: utf8
from __future__ import unicode_literals
import pytest
from flexmock import flexmock
from hypothesis import given, strategies
import abc

from .... import base


@pytest.mark.parametrize('new_name', ['mymodel', 'layer', 'basic', '', '漢字'])
def test_name_override(new_name):
    control = base.Model()
    assert control.name == 'model'
    model = base.Model(name=new_name)
    assert model.name == new_name
    assert model.name != 'model'
    control = base.Model()
    assert control.name == 'model'


@pytest.mark.parametrize('new_device', ['gpu', 'gpu1', 'foreign'])
def test_device_override(new_device):
    control = base.Model()
    assert control.device == 'cpu'
    model = base.Model(device=new_device)
    assert model.device == new_device
    assert model.device != 'cpu'
    control = base.Model()
    assert control.device == 'cpu'


def test_add_child_layer_instances():
    control = base.Model()
    assert len(control.layers) == 0
    model = base.Model(None, None,
                layers=(base.Model(name='child1'), base.Model(name='child2')))
    assert len(model.layers) == 2
    assert model.layers[0].name == 'child1'
    assert model.layers[1].name == 'child2'
    assert model.name == 'model'
    assert len(model.layers[0].layers) == 0
   

@@ -1,1283 +1,24 @@
-# encoding: utf8%0Afrom __future__ import unicode_literals%0Aimport pytest%0Afrom flexmock import flexmock%0Afrom hypothesis import given, strategies%0Aimport abc%0A%0Afrom .... import base%0A%0A%0A@pytest.mark.parametrize('new_name', %5B'mymodel', 'layer', 'basic', '', '%E6%BC%A2%E5%AD%97'%5D)%0Adef test_name_override(new_name):%0A    control = base.Model()%0A    assert control.name == 'model'%0A    model = base.Model(name=new_name)%0A    assert model.name == new_name%0A    assert model.name != 'model'%0A    control = base.Model()%0A    assert control.name == 'model'%0A%0A%0A@pytest.mark.parametrize('new_device', %5B'gpu', 'gpu1', 'foreign'%5D)%0Adef test_device_override(new_device):%0A    control = base.Model()%0A    assert control.device == 'cpu'%0A    model = base.Model(device=new_device)%0A    assert model.device == new_device%0A    assert model.device != 'cpu'%0A    control = base.Model()%0A    assert control.device == 'cpu'%0A%0A%0Adef test_add_child_layer_instances():%0A    control = base.Model()%0A    assert len(control.layers) == 0%0A    model = base.Model(None, None,%0A                layers=(base.Model(name='child1'), base.Model(name='child2')))%0A    assert len(model.layers) == 2%0A    assert model.layers%5B0%5D.name == 'child1'%0A    assert model.layers%5B1%5D.name == 'child2'%0A    assert model.name == 'model'%0A    assert len(model.layers%5B0%5D.layers) == 0%0A   
+from .... import base%0A%0A
 %0A

Remove tests or removed Model.setup method