Update tests and locations to reflect cura module move

This commit is contained in:
Ross Hendrickson 2013-09-08 19:49:26 -05:00
parent 520c856c57
commit 79f379a868
3 changed files with 13 additions and 12 deletions

View file

@ -14,14 +14,15 @@ class CuraFactory(object):
:param path: :class: `str`
"""
if path:
return CuraEngine(path)
return Cura(path)
current_settings = settings(init=True)
path = current_settings.get(["cura", "path"])
return CuraEngine(path)
return Cura(path)
class CuraEngine(object):
class Cura(object):
def __init__(self, cura_path):

View file

@ -3,8 +3,8 @@
import unittest
from mock import patch
from octoprint.cura import CuraFactory
from octoprint.cura import CuraEngine
from octoprint.slicers.cura import CuraFactory
from octoprint.slicers.cura import Cura
class CuraFactoryTestCase(unittest.TestCase):
@ -17,9 +17,8 @@ class CuraFactoryTestCase(unittest.TestCase):
self.assertEqual(fake_path, result.cura_path)
@patch('octoprint.cura.parser.process_profile_ini')
@patch('threading.Thread')
def test_cura_engine_process_file(self, thread, process):
def test_cura_engine_process_file(self, thread):
path = 'rosshendrickson/workspaces/opensource/CuraEngine/'
cura = CuraFactory.create_slicer(path)

View file

@ -4,6 +4,9 @@ from mock import patch
import logging
from octoprint.filemanager.destinations import FileDestinations
class FileManipulationTestCase(unittest.TestCase):
def setUp(self):
@ -22,7 +25,7 @@ class FileManipulationTestCase(unittest.TestCase):
logging.info("REMOVED %s filenames" % str(len(self.filenames)))
@patch('octoprint.cura.CuraEngine.process_file')
@patch('octoprint.slicers.cura.Cura.process_file')
def test_add_stl_file(self, process):
fake = Mock()
@ -30,12 +33,10 @@ class FileManipulationTestCase(unittest.TestCase):
self.filenames.append(fake.filename)
fake.__getitem__ = "SOMETHING"
result = self.manager.addFile(fake)
result = self.manager.addFile(fake, FileDestinations.LOCAL)
logging.info("RESULT:%s" % str(result))
self.assertIsNone(result)
self.assertTrue(process.called)
def test_add_gcode_file(self):
@ -44,7 +45,7 @@ class FileManipulationTestCase(unittest.TestCase):
self.filenames.append(fake.filename)
fake.__getitem__ = "SOMETHING"
result = self.manager.addFile(fake)
result = self.manager.addFile(fake, FileDestinations.LOCAL)
logging.info("RESULT:%s" % str(result))