---
p2v/client/test/cmdline_default | 1 +
p2v/client/test/cmdline_test | 1 +
p2v/client/test/test_newmain.rb | 49 +++++++++++++++++++++++++++++++++++++++++
3 files changed, 51 insertions(+)
create mode 100644 p2v/client/test/cmdline_default
create mode 100644 p2v/client/test/cmdline_test
create mode 100644 p2v/client/test/test_newmain.rb
diff --git a/p2v/client/test/cmdline_default b/p2v/client/test/cmdline_default
new file mode 100644
index 0000000..7766d17
--- /dev/null
+++ b/p2v/client/test/cmdline_default
@@ -0,0 +1 @@
+BOOT_IMAGE=/vmlinuz-3.9.9-301.fc19.x86_64 root=/dev/mapper/vg_jelly-lv_root ro
rd.lvm.lv=vg_jelly/lv_root rd.md=0 rd.dm=0 SYSFONT=True KEYTABLE=us
rd.lvm.lv=vg_jelly/lv_swap rd.luks.uuid=luks-2a7c6825-76a4-4b85-9eca-ec35bd682553
LANG=en_US.UTF-8 rhgb quiet
diff --git a/p2v/client/test/cmdline_test b/p2v/client/test/cmdline_test
new file mode 100644
index 0000000..6d84e8e
--- /dev/null
+++ b/p2v/client/test/cmdline_test
@@ -0,0 +1 @@
+BOOT_IMAGE=/vmlinuz-3.9.9-301.fc19.x86_64 root=/dev/mapper/vg_jelly-lv_root ro
rd.lvm.lv=vg_jelly/lv_root rd.md=0 rd.dm=0 SYSFONT=True KEYTABLE=us
rd.lvm.lv=vg_jelly/lv_swap rd.luks.uuid=luks-2a7c6825-76a4-4b85-9eca-ec35bd682553
LANG=en_US.UTF-8 p2v_test=foo rhgb quiet
diff --git a/p2v/client/test/test_newmain.rb b/p2v/client/test/test_newmain.rb
new file mode 100644
index 0000000..26a15a6
--- /dev/null
+++ b/p2v/client/test/test_newmain.rb
@@ -0,0 +1,49 @@
+require 'minitest/autorun'
+require 'virt-p2v/ui/main'
+
+WD = File.expand_path File.dirname(__FILE__)
+CMDLINE_TEST = File.join(WD, "cmdline_test")
+CMDLINE_DEFAULT = File.join(WD, "cmdline_default")
+
+class TestNewMainDry < MiniTest::Unit::TestCase
+ def setup
+ @nm = VirtP2V::UI::NewMain.new dry=true
+ end
+
+ def test_cmdline_parse_d
+ params = @nm.parse_cmdline(CMDLINE_DEFAULT)
+ assert_equal params, {}
+ end
+
+ def test_cmdline_parse_t
+ params = @nm.parse_cmdline(CMDLINE_TEST)
+ assert_equal params, {"test" => "foo"}
+ end
+
+ def test_cmdline_parse_noval
+ params = @nm.parse_cmdline
+ assert_equal params, {}
+ end
+end
+
+
+class TestNewMain < MiniTest::Unit::TestCase
+ def setup
+ @nm = VirtP2V::UI::NewMain.new
+ end
+
+ def test_cmdline_parse_d
+ params = @nm.parse_cmdline(CMDLINE_DEFAULT)
+ assert_equal params, {}
+ end
+
+ def test_cmdline_parse_t
+ params = @nm.parse_cmdline(CMDLINE_TEST)
+ assert_equal params, {"test" => "foo"}
+ end
+
+ def test_cmdline_parse_noval
+ params = @nm.parse_cmdline
+ assert_equal params, {}
+ end
+end
--
1.8.3.1