コード例 #1
0
 def test_data_sync(self, mock_path):
     mock_path.return_value = True
     with patch.dict('os.environ', {'HOME': '../data'}):
         root_import = RootImportBase(
             'root_dir', Uri('file:///image.tar.xz')
         )
     root_import.sync_data()
コード例 #2
0
ファイル: base_test.py プロジェクト: sitedata/kiwi-1
 def test_data_sync(self, mock_path):
     mock_path.return_value = True
     with patch.dict('os.environ', {'HOME': '../data'}):
         root_import = RootImportBase('root_dir',
                                      Uri('file:///image.tar.xz'))
     with raises(NotImplementedError):
         root_import.sync_data()
コード例 #3
0
 def test_init(self, mock_buildservice, mock_path):
     mock_buildservice.return_value = False
     mock_path.return_value = True
     with patch.dict('os.environ', {'HOME': '../data'}):
         RootImportBase('root_dir', Uri('file:///image.tar.xz'))
     assert mock_path.call_args_list == [
         call('../data/.config/kiwi/config.yml'),
         call('/image.tar.xz')
     ]
コード例 #4
0
 def test_init_non_existing(self, mock_path):
     mock_path.return_value = False
     with patch.dict('os.environ', {'HOME': '../data'}):
         RootImportBase('root_dir', Uri('file:///image.tar.xz'))
     mock_path.assert_called_once_with('/image.tar.xz')
コード例 #5
0
 def test_init_unknown_uri(self, mock_log_warn):
     root = RootImportBase('root_dir', Uri('docker://opensuse:leap'))
     assert root.unknown_uri == 'docker://opensuse:leap'
     assert mock_log_warn.called
コード例 #6
0
 def test_init_remote_uri(self):
     RootImportBase('root_dir', Uri('http://example.com/image.tar.xz'))
コード例 #7
0
ファイル: base_test.py プロジェクト: sitedata/kiwi-1
 def test_init_non_existing(self, mock_path):
     mock_path.return_value = False
     with patch.dict('os.environ', {'HOME': '../data'}):
         with raises(KiwiRootImportError):
             RootImportBase('root_dir', Uri('file:///image.tar.xz'))
コード例 #8
0
ファイル: base_test.py プロジェクト: sitedata/kiwi-1
 def test_init_remote_uri(self):
     with raises(KiwiRootImportError):
         RootImportBase('root_dir', Uri('http://example.com/image.tar.xz'))
コード例 #9
0
 def test_data_sync(self, mock_path):
     mock_path.return_value = True
     root_import = RootImportBase('root_dir', Uri('file:///image.tar.xz'))
     root_import.sync_data()
コード例 #10
0
 def test_init_non_existing(self, mock_path):
     mock_path.return_value = False
     RootImportBase('root_dir', Uri('file:///image.tar.xz'))
     mock_path.assert_called_once_with('/image.tar.xz')