code: def test_nav_absolute_links_with_validation(self):
      nav_cfg = [
          {"Home": "index.md"},
          {"Local page": "/foo/bar.md"},
          {"Local link": "/local.md"},
          {"External": "http://example.com/external.html"},
      ]
      expected = dedent(
          """
              Page(title='Home', url='/')
              Page(title='Local page', url='/foo/bar/')
              Link(title='Local link', url='/local.md')
              Link(title='External', url='http://example.com/external.html')
              """
      )
      cfg = load_config(
          nav=nav_cfg,
          site_url="http://example.com/",
          validation=dict(nav=dict(absolute_links="relative_to_docs")),
      )
      fs = [
          File(
              "index.md",
              cfg.docs_dir,
              cfg.site_dir,
              cfg.use_directory_urls,
          ),
          File(
              "foo/bar.md",
              cfg.docs_dir,
              cfg.site_dir,
              cfg.use_directory_urls,
          ),
      ]
      files = Files(fs)
      with self.assertLogs("mkdocs", level="DEBUG") as cm:
          site_navigation = get_navigation(files, cfg)
      self.assertEqual(
          cm.output,
          [
              "WARNING:mkdocs.structure.nav:A reference to '/local.md' is included in the 'nav' configuration, which is not found in the documentation files.",
              "DEBUG:mkdocs.structure.nav:An external link to 'http://example.com/external.html' is included in the 'nav' configuration.",
          ],
      )
      self.assertEqual(str(site_navigation).strip(), expected)
      self.assertEqual(len(site_navigation.items), 4)
      self.assertEqual(len(site_navigation.pages), 2)
  
imports: import sys
  import unittest
  from mkdocs.structure.files import File, Files, set_exclusions
  from mkdocs.structure.nav import Section, _get_by_type, get_navigation
  from mkdocs.structure.pages import Page
  from mkdocs.tests.base import dedent, load_config
label_desc: Use image node_id 6 for calling the SiteNavigationTests obj's underlying member method code with example usage: obj.test_nav_absolute_links_with_validation() without return types