2022-03-23 16:07:57 -07:00
|
|
|
import unittest
|
|
|
|
|
2023-11-30 18:11:36 -05:00
|
|
|
import pytest
|
|
|
|
|
2022-03-23 16:07:57 -07:00
|
|
|
from datahub.utilities.urns.notebook_urn import NotebookUrn
|
|
|
|
|
|
|
|
|
2023-11-30 18:11:36 -05:00
|
|
|
@pytest.mark.filterwarnings("ignore::DeprecationWarning")
|
2022-03-23 16:07:57 -07:00
|
|
|
class TestNotebookUrn(unittest.TestCase):
|
|
|
|
def test_parse_urn(self) -> None:
|
|
|
|
notebook_urn_str = "urn:li:notebook:(querybook,123)"
|
|
|
|
notebook_urn = NotebookUrn.create_from_string(notebook_urn_str)
|
|
|
|
assert notebook_urn.get_platform_id() == "querybook"
|
|
|
|
assert notebook_urn.get_notebook_id() == "123"
|
|
|
|
assert str(notebook_urn) == notebook_urn_str
|
|
|
|
|
2023-11-30 18:11:36 -05:00
|
|
|
assert notebook_urn == NotebookUrn("querybook", "123")
|