Exemplo n.º 1
0
 def test_get_column_max_len_int(self):
     data = [(1, 'd'), (11, 'd')]
     assert_that(UnityDoc.get_column_max_len(data), equal_to([2, 1]))
Exemplo n.º 2
0
 def test_get_fmt_str(self):
     assert_that(UnityDoc.get_fmt_str((3, 5, 2)), equal_to('{:5}{:7}{:4}'))
Exemplo n.º 3
0
 def test_get_column_max_len_str(self):
     data = [('but', '', 'd'), ('of', 'hand', 'i')]
     assert_that(UnityDoc.get_column_max_len(data), equal_to([3, 4, 1]))
Exemplo n.º 4
0
 def test_get_doc_of_resource(self):
     unity_doc = UnityDoc(t_rest(), UnityLun)
     doc = unity_doc._get_doc()
     assert_that(doc, contains_string('Represents Volume'))
Exemplo n.º 5
0
 def test_get_doc_of_index(self):
     unity_doc = UnityDoc(t_rest(), HealthEnum)
     doc = unity_doc._get_doc(value=5)
     assert_that(doc, equal_to('OK'))
Exemplo n.º 6
0
 def test_get_doc_of_resource(self):
     unity_doc = UnityDoc(t_rest(), UnityLun)
     doc = unity_doc._get_doc()
     assert_that(doc, contains_string('Represents Volume'))
Exemplo n.º 7
0
 def test_get_doc_of_field(self):
     unity_doc = UnityDoc(t_rest(), UnityLun)
     doc = unity_doc._get_doc(field='name')
     assert_that(doc, equal_to('Readable name'))
Exemplo n.º 8
0
 def test_get_column_max_len_int(self):
     data = [(1, 'd'), (11, 'd')]
     assert_that(UnityDoc.get_column_max_len(data), equal_to([2, 1]))
Exemplo n.º 9
0
 def test_format_prop_no_header(self):
     props = [('a', 'b'), ('cc', 'dd')]
     assert_that(UnityDoc.format_prop(props), equal_to(['a   b', 'cc  dd']))
Exemplo n.º 10
0
 def test_get_fmt_str(self):
     assert_that(UnityDoc.get_fmt_str((3, 5, 2)), equal_to('{:5}{:7}{:4}'))
Exemplo n.º 11
0
 def test_get_column_max_len_str(self):
     data = [('but', '', 'd'), ('of', 'hand', 'i')]
     assert_that(UnityDoc.get_column_max_len(data), equal_to([3, 4, 1]))
Exemplo n.º 12
0
 def test_get_doc_unity_resource_list(self):
     unity_doc = UnityDoc(t_rest(), UnityLunList)
     doc = unity_doc.doc
     assert_that(doc, contains_string('Represents Volume'))
     assert_that(doc, contains_string('current_node'))
     assert_that(doc, contains_string('Current SP'))
Exemplo n.º 13
0
 def test_get_doc_enum_list(self):
     unity_doc = UnityDoc(t_rest(), RaidTypeEnumList)
     doc = unity_doc.doc
     assert_that(doc, contains_string('RAID5 has the only'))
Exemplo n.º 14
0
 def test_get_doc_of_index(self):
     unity_doc = UnityDoc(t_rest(), HealthEnum)
     doc = unity_doc._get_doc(value=5)
     assert_that(doc, equal_to('OK'))
Exemplo n.º 15
0
 def test_format_prop_no_header(self):
     props = [('a', 'b'), ('cc', 'dd')]
     assert_that(UnityDoc.format_prop(props), equal_to(['a   b', 'cc  dd']))
Exemplo n.º 16
0
 def test_format_prop_with_header(self):
     props = [('a', 'b')]
     assert_that(UnityDoc.format_prop(props, header=('name', 'value')),
                 equal_to(['name  value', 'a     b']))
Exemplo n.º 17
0
 def test_format_prop_with_header(self):
     props = [('a', 'b')]
     assert_that(UnityDoc.format_prop(props, header=('name', 'value')),
                 equal_to(['name  value', 'a     b']))
Exemplo n.º 18
0
 def test_get_doc_of_field(self):
     unity_doc = UnityDoc(t_rest(), UnityLun)
     doc = unity_doc._get_doc(field='name')
     assert_that(doc, equal_to('Readable name'))