# Path: sc/scMetadata.py
# class scMetadata:
#     def __init__(self):
#         pass
# 
#     def appendData(self, filepath):
#         # Appends provinator data to the file passed in
#         with open(filepath, 'a') as provfile:
#             provfile.write(graphRegistry.scVocabRegistry.get_json_ld())
# 
#     def labelDictionary(self, label_prefix):
#         # Returns the label as a dictionary
#         # Get the label information from provinator
#         provOutput = graphRegistry.scVocabRegistry.get_json_ld()
#         # Remove any formatting characters
#         provOutput = re.sub('[\t\r\n\s+]', '', provOutput)
#         # Add the label prefix
#         newLabel = "{'" + label_prefix + "':'" + provOutput + "'}"
#         # Evaluate the string to create the dictionary
#         newLabel = ast.literal_eval(newLabel)
#         # Return the dictionary
#         return newLabel


import pytest
import os
import docker
from sc import scMetadata

def test_appendData():
    #Create scMetadata instance
    scmd = scMetadata.scMetadata()
    #Create a temporary file to append to.
    open('tempprov.txt', 'a').close()
    scmd.appendData('tempprov.txt')
    #Test that the file is not empty
    assert os.stat('tempprov.txt').st_size > 0
    os.remove('tempprov.txt')

def test_labelDictionary():
    #Create scMetadata instance

# Path: sc/scMetadata.py
# class scMetadata:
#     def __init__(self):
#         pass
# 
#     def appendData(self, filepath):
#         # Appends provinator data to the file passed in
#         with open(filepath, 'a') as provfile:
#             provfile.write(graphRegistry.scVocabRegistry.get_json_ld())
# 
#     def labelDictionary(self, label_prefix):
#         # Returns the label as a dictionary
#         # Get the label information from provinator
#         provOutput = graphRegistry.scVocabRegistry.get_json_ld()
#         # Remove any formatting characters
#         provOutput = re.sub('[\t\r\n\s+]', '', provOutput)
#         # Add the label prefix
#         newLabel = "{'" + label_prefix + "':'" + provOutput + "'}"
#         # Evaluate the string to create the dictionary
#         newLabel = ast.literal_eval(newLabel)
#         # Return the dictionary
#         return newLabel


# Path: tests/unit/test_scMetadata.py
import pytest
import os
import docker
from sc import scMetadata


def test_appendData():
    #Create scMetadata instance
    scmd = scMetadata.scMetadata()
    #Create a temporary file to append to.
    open('tempprov.txt', 'a').close()
    scmd.appendData('tempprov.txt')
    #Test that the file is not empty
    assert os.stat('tempprov.txt').st_size > 0
    os.remove('tempprov.txt')

def test_labelDictionary():
    #Create scMetadata instance

    scmd = scMetadata.scMetadata()