import StringIO import base64 import os import shlex import sys from conary.lib import util from jbutler import butlercfg from jbutler.lib import mainhandler from testrunner import testcase from testutils import mock import testsuite # Bootstrap the testsuite testsuite.setup() class TestCase(testcase.TestCaseWithWorkDir): testDirName = 'jbutler-test-' def setUp(self): testcase.TestCaseWithWorkDir.setUp(self) self.rootDir = self.workDir def mkdirs(self, path): if not path.startswith(os.sep): # Relative paths are relative to self.rootDir path = os.path.join(self.rootDir, path) util.mkdirChain(path) return path
# you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # import testsuite # Bootstrap the testsuite testsuite.setup() from catalogService.rest.models import images class ImagesTest(testsuite.TestCase): def testFreezeThaw(self): hndlr = images.Handler() instId = "ec2-adfadf" instLongName = "ec2/name" instShortName = instLongName.split('/')[-1] image = images.BaseImage(id = instId) self.failUnlessEqual(image.getId(), instId) self.failUnlessEqual(image.getLongName(), None)