from .common import _TestNeuronsBase, pyel, tel


# importing any one of these will induce the error
import neurondm.models.basic_neurons
#import neurondm.models.huang2017

# importing any of these will not
#import neurondm.example

# no error caused by the below
#from neurondm import Config, Neuron
#from neurondm.phenotype_namespaces import BBP
#config = Config('nothing')
#Neuron(BBP.Mouse)
#config.write()
#config.write_python()


class TestDoNothing(_TestNeuronsBase):
    def test_ttl_simple(self):
        from neurondm import Config, Neuron, Phenotype, NegPhenotype
        config = Config('test-ttl', ttl_export_dir=tel, py_export_dir=pyel)
        config.write()

        config2 = Config('test-ttl', ttl_export_dir=tel, py_export_dir=pyel)
        config2.load_existing()
        config2.write_python()

        config3 = Config('test-ttl', ttl_export_dir=tel, py_export_dir=pyel)
        config3.load_python()

    def test_py_simple(self):
        from neurondm import Config, Neuron, Phenotype, NegPhenotype

        config = Config('test-py', ttl_export_dir=tel, py_export_dir=pyel)
        config.write_python()

        config2 = Config('test-py', ttl_export_dir=tel, py_export_dir=pyel)
        config2.load_python()  # FIXME load existing python ...
        config2.write()

        config3 = Config('test-py', ttl_export_dir=tel, py_export_dir=pyel)
        config3.load_existing()

@@ -43,16 +43,148 @@
 , tel%0A%0A%0A
+def even_when_transient():%0A    # it looksl ike something is up with models%0A    # not related to anything in models/__init__.py%0A%0A    
 # import
@@ -226,16 +226,21 @@
 e error%0A
+    #
 import n
@@ -268,16 +268,20 @@
 neurons%0A
+    
 #import 
@@ -306,17 +306,128 @@
 ang2017%0A
-%0A
+    #import neurondm.models.cuts%0A    import neurondm.models.ma2015%0A    #from neurondm.models import ma2015%0A%0A    
 # import
@@ -452,16 +452,20 @@
 ill not%0A
+    
 #import 
@@ -481,17 +481,117 @@
 example%0A
-%0A
+    #import neurondm.models%0A    #import neurondm.lang%0A    #import neurondm.phenotype_namespaces%0A%0A    
 # no err
@@ -613,16 +613,20 @@
 e below%0A
+    
 #from ne
@@ -654,16 +654,20 @@
  Neuron%0A
+    
 #from ne
@@ -705,16 +705,20 @@
 ort BBP%0A
+    
 #config 
@@ -737,16 +737,20 @@
 thing')%0A
+    
 #Neuron(
@@ -760,16 +760,20 @@
 .Mouse)%0A
+    
 #config.
@@ -780,16 +780,20 @@
 write()%0A
+    
 #config.
@@ -809,16 +809,40 @@
 hon()%0A%0A%0A
+even_when_transient()%0A%0A%0A
 class Te

test madness narrowed to neurondm.modles, also note that Config managed to develop duplicate file and source_file kwargs (derp)