views.main: Handle the help menu in the main view
[git-cola.git] / test / test_cola_models_main.py
blobc993cdf1e1d55c9304379d36916b8be4974689d0
1 import helper
2 import os
4 from cola.models.main import MainModel
6 class MainModelTestCase(helper.TestCase):
7 """Tests the cola.models.main.MainModel class."""
9 def setup_baseline_repo(self, commit=True):
10 """Create a baseline repo for testing."""
11 self.shell("""
12 git init >/dev/null &&
13 touch the-file &&
14 git add the-file
15 """)
16 if commit:
17 self.shell("git commit -s -m'Initial commit' >/dev/null")
19 def test_project(self):
20 """Test the MainModel's 'project' attribute."""
21 self.setup_baseline_repo()
22 model = MainModel()
23 model.use_worktree(os.getcwd())
24 project = os.path.basename(self.get_dir())
25 self.assertEqual(project, model.project)