code: def test_api_status(capsys, repo, per_tensor):
      # delete the repo and initialize a new one:
      shutil.rmtree(".wgit")
      repo = Repo(Path.cwd(), init=True)
  
      # check status before any file is added
      out = repo.status()
      assert out == {"": RepoStatus.CLEAN}
  
      # check status before after a file is added but not committed
      chkpt0 = f"checkpoint_{random.randint(0, 1)}.pt"
      repo.add(chkpt0, per_tensor=per_tensor)
      out = repo.status()
      key_list = list(repo._get_metdata_files().keys())
      assert out == {key_list[0]: RepoStatus.CHANGES_ADDED_NOT_COMMITED}
  
      # check status after commit
      repo.commit("e1")
      out = repo.status()
      assert out == {key_list[0]: RepoStatus.CLEAN}
  
      # check status after a new change has been made to the file
      torch.save(nn.Linear(1, int(15e5)).state_dict(), chkpt0)
      out = repo.status()
      assert out == {key_list[0]: RepoStatus.CHANGES_NOT_ADDED}
  
      # add the new changes made to weigit
      repo.add(chkpt0, per_tensor=per_tensor)
      out = repo.status()
      assert out == {key_list[0]: RepoStatus.CHANGES_ADDED_NOT_COMMITED}
  
      # check status after a new different file is added to be tracked by weigit
      chkpt3 = "checkpoint_3.pt"
      repo.add(chkpt3, per_tensor=per_tensor)
      key_list = list(repo._get_metdata_files().keys())
      out = repo.status()
      assert out == {
          key_list[0]: RepoStatus.CHANGES_ADDED_NOT_COMMITED,
          key_list[1]: RepoStatus.CHANGES_ADDED_NOT_COMMITED,
      }
  
      # check status after the new file is commited to be tracked by weigit
      repo.commit("e2")
      out = repo.status()
      assert out == {
          key_list[0]: RepoStatus.CLEAN,
          key_list[1]: RepoStatus.CLEAN,
      }
  
file_path: fairscale/tests/experimental/wgit/test_api.py
imports: import json
  import os
  from pathlib import Path
  import random
  import shutil
  import pytest
  import torch
  from torch import nn
  from fairscale.experimental.wgit.repo import Repo, RepoStatus
label_desc: Use image node_id 7 for calling a global function with example usage: test_api_status(capsys, repo, per_tensor) without return types