Skip to main content

Source code Changes To

pkg-gate / src / tests / cli / t_change_facet.py

From revision 2909 to 2910:

diff -r bcafb737718d -r 2bb9f6ffdff9 src/tests/cli/t_change_facet.py
--- a/src/tests/cli/t_change_facet.py	Wed Jun 12 15:44:50 2013 -0700
+++ b/src/tests/cli/t_change_facet.py	Wed Jun 19 15:54:08 2013 -0700
@@ -20,7 +20,7 @@
 # CDDL HEADER END
 #
 
-# Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
 
 import testutils
 if __name__ == "__main__":
@@ -122,7 +122,7 @@
 
                 self.pkg_image_create(self.rurl, additional_args=ic_args)
                 self.pkg("facet")
-                self.pkg("facet -H 'facet.locale*' | egrep False")
+                self.pkg("facet -H -F tsv 'facet.locale*' | egrep False")
 
                 # install a package and verify
                 alist = [self.plist[0]]
@@ -145,7 +145,7 @@
                 # are in effect
                 self.pkg("change-facet -n --parsable=0 wombat=false")
                 self.assertEqualParsable(self.output,
-                    affect_packages=alist,
+                    affect_packages=[],
                     change_facets=[["facet.wombat", False]])
 
                 # Again, but this time after removing the publisher cache data
@@ -157,7 +157,7 @@
                 self.pkg("change-facet --no-refresh -n --parsable=0 "
                     "wombat=false", su_wrap=True)
                 self.assertEqualParsable(self.output,
-                    affect_packages=alist,
+                    affect_packages=[],
                     change_facets=[["facet.wombat", False]])
 
                 # Again, but this time after removing the cache directory
@@ -168,7 +168,7 @@
                 self.pkg("change-facet --no-refresh -n --parsable=0 "
                     "wombat=false", su_wrap=True)
                 self.assertEqualParsable(self.output,
-                    affect_packages=alist,
+                    affect_packages=[],
                     change_facets=[["facet.wombat", False]])
 
                 # change to pick up another file w/ two tags and test the
@@ -252,8 +252,8 @@
                 # Test that setting a non-existent facet to True then removing
                 # it works.
                 self.pkg("change-facet -v foo=True")
-                self.pkg("facet -H")
-                self.assertEqual("facet.foo True\n", self.output)
+                self.pkg("facet -H -F tsv")
+                self.assertEqual("facet.foo\tTrue\n", self.output)
                 self.pkg("change-facet --parsable=0 foo=None")
                 self.assertEqualParsable(self.output, change_facets=[
                     ["facet.foo", None]])
@@ -291,12 +291,11 @@
                 # install a random package and make sure we don't accidentally
                 # change facets.
                 self.pkg("install pkg_B@1.0")
-                self.pkg("facet -H")
-                output = self.reduceSpaces(self.output)
+                self.pkg("facet -H -F tsv")
                 expected = (
-                    "facet.locale.fr_FR False\n"
-                    "facet.locale.fr False\n")
-                self.assertEqualDiff(expected, output)
+                    "facet.locale.fr\tFalse\n"
+                    "facet.locale.fr_FR\tFalse\n")
+                self.assertEqualDiff(expected, self.output)
                 for i in [ 0, 3, 4, 5, 6, 7 ]:
                         self.assert_file_is_there(str(i))
                 for i in [ 1, 2 ]:
@@ -306,12 +305,11 @@
                 # update an image and make sure we don't accidentally change
                 # facets.
                 self.pkg("update")
-                self.pkg("facet -H")
-                output = self.reduceSpaces(self.output)
+                self.pkg("facet -H -F tsv")
                 expected = (
-                    "facet.locale.fr_FR False\n"
-                    "facet.locale.fr False\n")
-                self.assertEqualDiff(expected, output)
+                    "facet.locale.fr\tFalse\n"
+                    "facet.locale.fr_FR\tFalse\n")
+                self.assertEqualDiff(expected, self.output)
                 for i in [ 0, 3, 4, 5, 6, 7 ]:
                         self.assert_file_is_there(str(i))
                 for i in [ 1, 2 ]:
@@ -333,10 +331,10 @@
 
                 # set a facet on an image with no facets
                 self.pkg("change-facet -v locale.fr=False")
-                self.pkg("facet -H")
+                self.pkg("facet -H -F tsv")
                 output = self.reduceSpaces(self.output)
                 expected = (
-                    "facet.locale.fr False\n")
+                    "facet.locale.fr\tFalse\n")
                 self.assertEqualDiff(expected, output)
                 for i in [ 0, 2, 3, 4, 5, 6, 7 ]:
                         self.assert_file_is_there(str(i))
@@ -346,12 +344,11 @@
 
                 # set a facet on an image with existing facets
                 self.pkg("change-facet -v locale.fr_FR=False")
-                self.pkg("facet -H")
-                output = self.reduceSpaces(self.output)
+                self.pkg("facet -H -F tsv")
                 expected = (
-                    "facet.locale.fr_FR False\n"
-                    "facet.locale.fr False\n")
-                self.assertEqualDiff(expected, output)
+                    "facet.locale.fr\tFalse\n"
+                    "facet.locale.fr_FR\tFalse\n")
+                self.assertEqualDiff(expected, self.output)
                 for i in [ 0, 3, 4, 5, 6, 7 ]:
                         self.assert_file_is_there(str(i))
                 for i in [ 1, 2 ]:
@@ -361,11 +358,11 @@
                 # clear a facet while setting a facet on an image with other
                 # facets that aren't being changed
                 self.pkg("change-facet -v locale.fr=None locale.nl=False")
-                self.pkg("facet -H")
+                self.pkg("facet -H -F tsv")
                 output = self.reduceSpaces(self.output)
                 expected = (
-                    "facet.locale.fr_FR False\n"
-                    "facet.locale.nl False\n")
+                    "facet.locale.fr_FR\tFalse\n"
+                    "facet.locale.nl\tFalse\n")
                 self.assertEqualDiff(expected, output)
                 for i in [ 0, 1, 3, 4, 6, 7 ]:
                         self.assert_file_is_there(str(i))
@@ -376,10 +373,10 @@
                 # clear a facet on an image with other facets that aren't
                 # being changed
                 self.pkg("change-facet -v locale.nl=None")
-                self.pkg("facet -H")
+                self.pkg("facet -H -F tsv")
                 output = self.reduceSpaces(self.output)
                 expected = (
-                    "facet.locale.fr_FR False\n")
+                    "facet.locale.fr_FR\tFalse\n")
                 self.assertEqualDiff(expected, output)
                 for i in [ 0, 1, 3, 4, 5, 6, 7 ]:
                         self.assert_file_is_there(str(i))
@@ -389,7 +386,7 @@
 
                 # clear the only facet on an image
                 self.pkg("change-facet -v locale.fr_FR=None")
-                self.pkg("facet -H")
+                self.pkg("facet -H -F tsv")
                 self.assertEqualDiff("", self.output)
                 for i in range(8):
                         self.assert_file_is_there(str(i))

 
 
Close
loading
Please Confirm
Close