@@ -50,6 +50,43 @@ def test_set_url(batch_request_item):
50
50
assert batch_request_item .url == "/v1.0/me"
51
51
52
52
53
+ def test_constructor_url_replacement ():
54
+ request_info = RequestInformation ()
55
+ request_info .http_method = "GET"
56
+ request_info .url = "https://graph.microsoft.com/v1.0/users/me-token-to-replace"
57
+ request_info .headers = RequestHeaders ()
58
+ request_info .content = None
59
+
60
+ batch_request_item = BatchRequestItem (request_info )
61
+
62
+ assert batch_request_item .url == "https://graph.microsoft.com/v1.0/me"
63
+
64
+
65
+ def test_set_url_replacement ():
66
+ request_info = RequestInformation ()
67
+ request_info .http_method = "GET"
68
+ request_info .url = "https://graph.microsoft.com/v1.0/users/me-token-to-replace"
69
+ request_info .headers = RequestHeaders ()
70
+ request_info .content = None
71
+
72
+ batch_request_item = BatchRequestItem (request_info )
73
+ batch_request_item .set_url ("https://graph.microsoft.com/v1.0/users/me-token-to-replace" )
74
+
75
+ assert batch_request_item .url == "/v1.0/me"
76
+
77
+
78
+ def test_constructor_url_replacement_with_query ():
79
+ request_info = RequestInformation ()
80
+ request_info .http_method = "GET"
81
+ request_info .url = "https://graph.microsoft.com/v1.0/users/me-token-to-replace?param=value"
82
+ request_info .headers = RequestHeaders ()
83
+ request_info .content = None
84
+
85
+ batch_request_item = BatchRequestItem (request_info )
86
+
87
+ assert batch_request_item .url == "https://graph.microsoft.com/v1.0/me?param=value"
88
+
89
+
53
90
def test_id_property (batch_request_item ):
54
91
batch_request_item .id = "new_id"
55
92
assert batch_request_item .id == "new_id"
0 commit comments