Skip to content

Commit

Permalink
wrote tests for bin
Browse files Browse the repository at this point in the history
  • Loading branch information
toumorokoshi committed Feb 10, 2015
1 parent a4ce3a4 commit 862acfe
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
]

setup(name='uranium',
version='0.0.49',
version='0.0.52',
description='a build system for python',
long_description='a build system for python',
author='Yusuke Tsutsumi',
Expand Down
20 changes: 20 additions & 0 deletions uranium/tests/test_plugin_api/test_bin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import shutil
import tempfile
from nose.tools import ok_
from uranium.bin import BinDirectory
from uranium.config import Config
from uranium.uranium import Uranium


class TestBinEndpoint(object):

def setUp(self):
self.root = tempfile.mkdtemp()
self.config = Config({})
self.uranium = Uranium(self.config, root=self.root)

def tearDown(self):
shutil.rmtree(self.root)

def test_bin_lazyload(self):
ok_(isinstance(self.uranium.bin, BinDirectory))
5 changes: 3 additions & 2 deletions uranium/uranium.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ def root(self):

@property
def bin(self):
if not self._bin:
self._bin = BinDirectory(self._root, BIN_DIRECTORY)
if not hasattr(self, '_bin'):
self._bin = BinDirectory(
os.path.join(self._root, BIN_DIRECTORY))
return self._bin

@property
Expand Down

0 comments on commit 862acfe

Please sign in to comment.