# Path: Graphyne/DatabaseDrivers/DriverTermplate.py
# class LogLevel(object):
# class LogType(object):
# class EntityActiveState(object):
# class LinkType(object):
# class LinkDirectionType(object):
# class linkAttributeOperatorType(object):
# class EntityRepository(object):
# class EntityLink(object):
# class LinkRepository(object):
#     def __init__(self):
#     def __init__(self):
# def initialize(iapi, itemplateRepository, ilogQ, iConnection, passedPersistence = None, reInitialize = False):
#     def __init__(self):
#     def getEntitiesByTag(self, tag, zone = None):
#     def getEntitiesByType(self, memePath, zone = None):
#     def getEntitiesByMetaMemeType(self, metaMemePath, zone = None):
#     def getEntitiesByPage(self, zone):
#     def getEntity(self, uuid):
#     def getAllEntities(self, activeState = entityActiveStates.ACTIVE):
#     def addEntity(self, entity):
#     def removeEntity(self):
#     def __init__(self, memberID1, memberID2, membershipType, linkAttributes = {}, masterEntity = None):
#     def getMembershipType(self):
#     def makeAtomic(self):
#     def makeSubAtomic(self, masterEntity):
#     def makeAlias(self, keyLink):
#     def getCounterpartUUID(self, uuid):
#     def getCounterpartEntity(self, uuid):
#     def getKeyLink(self):
#     def getMasterEntityUUID(self):
#     def getMasterEntity(self):
#     def __init__(self):
#     def getAllLinks(self, entityUUID):
#     def getAllInboundLinks(self, entityUUID):
#     def getAllOutboundLinks(self, entityUUID):
#     def getCounterpartIndices(self, entityUUID):
#     def getCounterparts(self, entityUUID, linkDirection = linkDirectionType.BIDIRECTIONAL, traverseParameters = [], nodeParameters = [], memType = None, excludeLinks = []):
#     def testLinkedEntityForAttributes(self, entityID, nodeParameters = []): 
#     def testLinkForAttribute(self, linkID, attributeName = '', value = None, operator = linkAttributeOperator.EQUAL):
#     def removeLink(self, memberID1, memberID2, traverseParameters = []):
#     def catalogLink(self, memberID1, memberID2, membershipType = 0, linkAttributes = {}, masterEntity = None):  
# def testEntityForAttribute(entityID, attributeName = '', value = None, operator = linkAttributeOperator.EQUAL):
# def getUUIDAsString(uuidToParse):
# def filterListDuplicates(listToFilter):
#     ACTIVE = 0
#     DEPRICATED = 1
#     ALL = 2
#     ATOMIC = 0
#     SUBATOMIC = 1
#     ALIAS = 2 
#     BIDIRECTIONAL = 0
#     OUTBOUND = 1
#     INBOUND = 2
#     EQUAL = 0
#     EQUALORGREATER = 1
#     EQUALORLESS = 2
#     GREATER = 3
#     LESS = 4
#     NOTEQUAL = 5
#     IN = 6
#     NOTIN = 7


from tkinter.test.runtktests import this_dir_path
from Graphyne.DatabaseDrivers.DriverTermplate import linkTypes
from xml.dom import minidom
from time import ctime
from os.path import expanduser
        from Config.Test.TestRepository import InstallPyExecTest as testMod
            from Graphyne.DatabaseDrivers import NonPersistent as persistenceModule1
            from Graphyne.DatabaseDrivers import RelationalDatabase as persistenceModule2
            from Graphyne.DatabaseDrivers import RelationalDatabase as persistenceModule4
            from Graphyne.DatabaseDrivers import RelationalDatabase as persistenceModul3
            from Graphyne.DatabaseDrivers import RelationalDatabase as persistenceModul32
import copy
import os
import codecs
import time
import decimal
import queue
import sys
import argparse
import Graphyne.Graph as Graph
import Graphyne.Fileutils as Fileutils
import Graphyne.Exceptions as Exceptions
    Graph.logQ.put( [logType , logLevel.DEBUG , method , "exiting"])
    return resultSet




def testAtomicSubatomic():
    """
        Test atomic/subatomic links defined in memes.
    """
    method = moduleName + '.' + 'testAtomicSubatomic'
    Graph.logQ.put( [logType , logLevel.DEBUG , method , "entering"])

    resultSet = []
    errata = []
    testResult = "True"
    expectedResult = "True"
    errorMsg = ""
    
    #The testcase entities
    try:
        parentMeme1 = Graph.api.createEntityFromMeme("AtomicSubatomic.ParentMeme1")  #Both shild entites have subatomic links
        parentMeme2 = Graph.api.createEntityFromMeme("AtomicSubatomic.ParentMeme2")  #One child has an atomic link, the other subatomic
        parentMeme3 = Graph.api.createEntityFromMeme("AtomicSubatomic.ParentMeme3")  #Both shild entites have atomic links
    except Exception as e:
        testResult = "False"
        errorMsg = ('Error creating test entities!  Traceback = %s' % (e) )
        errata.append(errorMsg)

    try:

# Path: Graphyne/DatabaseDrivers/DriverTermplate.py
# class LogLevel(object):
# class LogType(object):
# class EntityActiveState(object):
# class LinkType(object):
# class LinkDirectionType(object):
# class linkAttributeOperatorType(object):
# class EntityRepository(object):
# class EntityLink(object):
# class LinkRepository(object):
#     def __init__(self):
#     def __init__(self):
# def initialize(iapi, itemplateRepository, ilogQ, iConnection, passedPersistence = None, reInitialize = False):
#     def __init__(self):
#     def getEntitiesByTag(self, tag, zone = None):
#     def getEntitiesByType(self, memePath, zone = None):
#     def getEntitiesByMetaMemeType(self, metaMemePath, zone = None):
#     def getEntitiesByPage(self, zone):
#     def getEntity(self, uuid):
#     def getAllEntities(self, activeState = entityActiveStates.ACTIVE):
#     def addEntity(self, entity):
#     def removeEntity(self):
#     def __init__(self, memberID1, memberID2, membershipType, linkAttributes = {}, masterEntity = None):
#     def getMembershipType(self):
#     def makeAtomic(self):
#     def makeSubAtomic(self, masterEntity):
#     def makeAlias(self, keyLink):
#     def getCounterpartUUID(self, uuid):
#     def getCounterpartEntity(self, uuid):
#     def getKeyLink(self):
#     def getMasterEntityUUID(self):
#     def getMasterEntity(self):
#     def __init__(self):
#     def getAllLinks(self, entityUUID):
#     def getAllInboundLinks(self, entityUUID):
#     def getAllOutboundLinks(self, entityUUID):
#     def getCounterpartIndices(self, entityUUID):
#     def getCounterparts(self, entityUUID, linkDirection = linkDirectionType.BIDIRECTIONAL, traverseParameters = [], nodeParameters = [], memType = None, excludeLinks = []):
#     def testLinkedEntityForAttributes(self, entityID, nodeParameters = []): 
#     def testLinkForAttribute(self, linkID, attributeName = '', value = None, operator = linkAttributeOperator.EQUAL):
#     def removeLink(self, memberID1, memberID2, traverseParameters = []):
#     def catalogLink(self, memberID1, memberID2, membershipType = 0, linkAttributes = {}, masterEntity = None):  
# def testEntityForAttribute(entityID, attributeName = '', value = None, operator = linkAttributeOperator.EQUAL):
# def getUUIDAsString(uuidToParse):
# def filterListDuplicates(listToFilter):
#     ACTIVE = 0
#     DEPRICATED = 1
#     ALL = 2
#     ATOMIC = 0
#     SUBATOMIC = 1
#     ALIAS = 2 
#     BIDIRECTIONAL = 0
#     OUTBOUND = 1
#     INBOUND = 2
#     EQUAL = 0
#     EQUALORGREATER = 1
#     EQUALORLESS = 2
#     GREATER = 3
#     LESS = 4
#     NOTEQUAL = 5
#     IN = 6
#     NOTIN = 7


# Path: Smoketest.py
from tkinter.test.runtktests import this_dir_path
from Graphyne.DatabaseDrivers.DriverTermplate import linkTypes
from xml.dom import minidom
from time import ctime
from os.path import expanduser
        from Config.Test.TestRepository import InstallPyExecTest as testMod
            from Graphyne.DatabaseDrivers import NonPersistent as persistenceModule1
            from Graphyne.DatabaseDrivers import RelationalDatabase as persistenceModule2
            from Graphyne.DatabaseDrivers import RelationalDatabase as persistenceModule4
            from Graphyne.DatabaseDrivers import RelationalDatabase as persistenceModul3
            from Graphyne.DatabaseDrivers import RelationalDatabase as persistenceModul32
import copy
import os
import codecs
import time
import decimal
import queue
import sys
import argparse
import Graphyne.Graph as Graph
import Graphyne.Fileutils as Fileutils
import Graphyne.Exceptions as Exceptions

    Graph.logQ.put( [logType , logLevel.DEBUG , method , "exiting"])
    return resultSet




def testAtomicSubatomic():
    """
        Test atomic/subatomic links defined in memes.
    """
    method = moduleName + '.' + 'testAtomicSubatomic'
    Graph.logQ.put( [logType , logLevel.DEBUG , method , "entering"])

    resultSet = []
    errata = []
    testResult = "True"
    expectedResult = "True"
    errorMsg = ""
    
    #The testcase entities
    try:
        parentMeme1 = Graph.api.createEntityFromMeme("AtomicSubatomic.ParentMeme1")  #Both shild entites have subatomic links
        parentMeme2 = Graph.api.createEntityFromMeme("AtomicSubatomic.ParentMeme2")  #One child has an atomic link, the other subatomic
        parentMeme3 = Graph.api.createEntityFromMeme("AtomicSubatomic.ParentMeme3")  #Both shild entites have atomic links
    except Exception as e:
        testResult = "False"
        errorMsg = ('Error creating test entities!  Traceback = %s' % (e) )
        errata.append(errorMsg)

    try:

        pm1aChildren = api.getLinkCounterpartsByMetaMemeType(parentMeme1, "AtomicSubatomic.ChildMM", linkTypes.ATOMIC)