Skip to content
This repository has been archived by the owner on Mar 14, 2019. It is now read-only.

Commit

Permalink
Fix running tests on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
TwoWheelDev committed Feb 4, 2015
1 parent 6611bf5 commit 5558512
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,27 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import unittest
import sys
from gns3converter import utils


class TestUtils(unittest.TestCase):
def test_fix_path_win(self):
res = utils.fix_path('configs\R1.cfg')
self.assertEqual(res, 'configs/R1.cfg')

if sys.platform == 'win32':
exp_res = 'configs\\R1.cfg'
else:
exp_res = 'configs/R1.cfg'

self.assertEqual(res, exp_res)

def test_fix_path_unix(self):
res = utils.fix_path('configs/R1.cfg')
self.assertEqual(res, 'configs/R1.cfg')

if sys.platform == 'win32':
exp_res = 'configs\\R1.cfg'
else:
exp_res = 'configs/R1.cfg'

self.assertEqual(res, exp_res)

0 comments on commit 5558512

Please sign in to comment.