# Path: importer/load.py
# def generate_command_for_record(record):
# def open_or_default(path, default):
# def commands_from_data(data):
# def main(argv=None):


import errno
import json
import mock
import os
import socket
import shutil
import subprocess
import sys
import requests
from importer import load
from nose_parameterized import parameterized
from six.moves import StringIO
from testtools import (ExpectedException, TestCase)
from testtools.matchers import Equals
        while True:
            line = cls.process.stdout.readline()
            if line.strip():
                print(line.strip())
            if "Remote interface" in str(line):
                success = True
                break

        if not success:
            raise RuntimeError("Database failed to boot.")

        # Reset the credentials
        requests.post("http://localhost:7474/user/neo4j/authorization_token",
                      json={
                          "password": "neo4j",
                          "new_authorization_token": TEST_TOKEN
                      })

    @classmethod
    def tearDownClass(cls):
        """Kill the database process."""
        cls.process.kill()

    def setUp(self):
        """Log in using neo4j/cits3200 and clear all data."""
        super(TestImporterLoad, self).setUp()
        run_query("CYPHER 1.9 START n=node(*) DETACH DELETE n")

    def test_create_article(self):
        """4.5.5.0 Can create article."""

# Path: importer/load.py
# def generate_command_for_record(record):
# def open_or_default(path, default):
# def commands_from_data(data):
# def main(argv=None):


# Path: test/test_importer.py
import errno
import json
import mock
import os
import socket
import shutil
import subprocess
import sys
import requests
from importer import load
from nose_parameterized import parameterized
from six.moves import StringIO
from testtools import (ExpectedException, TestCase)
from testtools.matchers import Equals

        while True:
            line = cls.process.stdout.readline()
            if line.strip():
                print(line.strip())
            if "Remote interface" in str(line):
                success = True
                break

        if not success:
            raise RuntimeError("Database failed to boot.")

        # Reset the credentials
        requests.post("http://localhost:7474/user/neo4j/authorization_token",
                      json={
                          "password": "neo4j",
                          "new_authorization_token": TEST_TOKEN
                      })

    @classmethod
    def tearDownClass(cls):
        """Kill the database process."""
        cls.process.kill()

    def setUp(self):
        """Log in using neo4j/cits3200 and clear all data."""
        super(TestImporterLoad, self).setUp()
        run_query("CYPHER 1.9 START n=node(*) DETACH DELETE n")

    def test_create_article(self):
        """4.5.5.0 Can create article."""

        run_commands(load.commands_from_data([ENTRY_VALUES]))