コード例 #1
0
 def test_default_option_values(self):
     data = [0] * 10
     binfile = self.write_bin_file(data, suffix='.bin')
     bin2tap.main((binfile, ))
     ram, clear, org, start, stack, tapfile, scr = run_args
     self.assertEqual(ram, bytearray(data))
     self.assertIsNone(clear)
     self.assertEqual(org, 65536 - len(data))
     self.assertEqual(start, org)
     self.assertEqual(stack, org)
     self.assertEqual(tapfile, binfile[:-4] + '.tap')
     self.assertIsNone(scr)
コード例 #2
0
ファイル: test_bin2tap.py プロジェクト: skoolkid/skoolkit
 def test_default_option_values(self):
     data = [0] * 10
     binfile = self.write_bin_file(data, suffix='.bin')
     bin2tap.main((binfile,))
     ram, clear, org, start, stack, tapfile, scr = run_args
     self.assertEqual(ram, bytearray(data))
     self.assertIsNone(clear)
     self.assertEqual(org, 65536 - len(data))
     self.assertEqual(start, org)
     self.assertEqual(stack, org)
     self.assertEqual(tapfile, binfile[:-4] + '.tap')
     self.assertIsNone(scr)
コード例 #3
0
ファイル: test_bin2tap.py プロジェクト: TitsMagee/skoolkit
 def test_default_option_values(self):
     self.mock(bin2tap, 'run', mock_run)
     data = [0] * 10
     binfile = self.write_bin_file(data, suffix='.bin')
     bin2tap.main((binfile,))
     ram, org, start, stack, infile, tapfile = run_args
     self.assertEqual(ram, bytearray(data))
     self.assertEqual(org, 65536 - len(data))
     self.assertEqual(start, org)
     self.assertEqual(stack, org)
     self.assertEqual(infile, binfile)
     self.assertEqual(tapfile, binfile[:-4] + '.tap')
コード例 #4
0
ファイル: bin2tap.py プロジェクト: TitsMagee/skoolkit
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# Copyright 2012-2013 Richard Dymond ([email protected])
#
# This file is part of SkoolKit.
#
# SkoolKit is free software: you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation, either version 3 of the License, or (at your option) any later
# version.
#
# SkoolKit is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# SkoolKit. If not, see <http://www.gnu.org/licenses/>.

import sys

from skoolkit import bin2tap, error, SkoolKitError

try:
    bin2tap.main(sys.argv[1:])
except SkoolKitError as e:
    error(e.args[0])
コード例 #5
0
#!/usr/bin/env python3

# Copyright 2012-2013, 2017 Richard Dymond ([email protected])
#
# This file is part of SkoolKit.
#
# SkoolKit is free software: you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation, either version 3 of the License, or (at your option) any later
# version.
#
# SkoolKit is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# SkoolKit. If not, see <http://www.gnu.org/licenses/>.

import sys

from skoolkit import bin2tap, error, SkoolKitError

try:
    bin2tap.main(sys.argv[1:])
except SkoolKitError as e:
    error(e.args[0])