-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathvector.py
More file actions
58 lines (41 loc) · 1.08 KB
/
vector.py
File metadata and controls
58 lines (41 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
from cloudquery.sdk.scalar import String, Bool, Vector
def test_vector_append():
s = type(String())
v = Vector(s)
assert v == Vector(s)
v.append(String(True, "a string"))
v.append(String(True, "another string"))
v.append(String(False))
assert len(v) == 3
def test_vector_invalid_type_append():
s = type(String())
v = Vector(s)
b = Bool(True, True)
try:
v.append(b)
assert False
except:
assert True
def test_vector_eq():
s = type(String())
v1 = Vector(s)
v1.append(String(True, "a string"))
v2 = Vector(s)
v2.append(String(True, "a string"))
assert v1 == v2
def test_vector_ineq():
s = type(String())
v1 = Vector(s)
v1.append(String(True, "a string"))
v2 = Vector(s)
v2.append(String(True, "another string"))
assert v1 != v2
def test_vector_ineq_order():
s = type(String())
v1 = Vector(s)
v1.append(String(True, "a"))
v1.append(String(True, "b"))
v2 = Vector(s)
v2.append(String(True, "b"))
v2.append(String(True, "a"))
assert v1 != v2