2
0
mirror of https://github.com/frappe/bench.git synced 2024-09-29 07:19:05 +00:00

test: Updated tests for is_valid_frappe_branch

This commit is contained in:
Aradhya 2022-03-07 19:16:29 +05:30
parent 6c15327348
commit 17888a5ce5

View File

@ -5,7 +5,7 @@ import unittest
from bench.app import App from bench.app import App
from bench.bench import Bench from bench.bench import Bench
from bench.utils import is_valid_frappe_branch from bench.utils import is_valid_frappe_branch
from bench.exceptions import InvalidRemoteException
class TestUtils(unittest.TestCase): class TestUtils(unittest.TestCase):
def test_app_utils(self): def test_app_utils(self):
@ -27,10 +27,11 @@ class TestUtils(unittest.TestCase):
) )
def test_is_valid_frappe_branch(self): def test_is_valid_frappe_branch(self):
self.assertTrue(is_valid_frappe_branch("https://github.com/frappe/frappe", frappe_branch="")) with self.assertRaises(InvalidRemoteException):
self.assertTrue(is_valid_frappe_branch("https://github.com/frappe/frappe", frappe_branch="develop")) is_valid_frappe_branch("https://github.com/frappe/frappe.git", frappe_branch="random-branch")
self.assertTrue(is_valid_frappe_branch("https://github.com/frappe/erpnext", frappe_branch="version-13")) is_valid_frappe_branch("https://github.com/random/random.git", frappe_branch="random-branch")
self.assertFalse(is_valid_frappe_branch("https://github.com/frappe/erpnext", frappe_branch="version-1"))
is_valid_frappe_branch("https://github.com/frappe/frappe.git", frappe_branch="develop")
def test_app_states(self): def test_app_states(self):
bench_dir = "./sandbox" bench_dir = "./sandbox"