Source identity
| Field | Recorded value |
|---|---|
| Source type | GitHub source |
| Original record | Janady13/missionmatch / internal/platform/bls/occupations_test.go |
| Date | Not specified in source |
| Repository | Janady13/missionmatch |
| Revision | 720d47fae476b0d38477ae4401697d372b1ea2bc |
| Branch | feature/opportunity-to-outcome |
| Path or archive member | internal/platform/bls/occupations_test.go |
| Original SHA-256 | ee27c37832ebed64ed893adc72d6c6354ed952666f39afc1908a5596e29d1ce3 |
| Git blob SHA | 55151eae9a9be4c72e39590ea6256512122bed85 |
| Reading-copy SHA-256 | ee27c37832ebed64ed893adc72d6c6354ed952666f39afc1908a5596e29d1ce3 |
Every recorded occurrence
These 11 records contain identical original source bytes. Their paths and revisions remain part of the archive.
| Original record | Branch or archive | Revision / identifier | Original location |
|---|---|---|---|
| Janady13/missionmatch / internal/platform/bls/occupations_test.go | feature/opportunity-to-outcome | 720d47fae476b0d38477ae4401697d372b1ea2bc | Open original |
| Janady13/missionmatch / internal/platform/bls/occupations_test.go | collision-deconfliction | 4ee5a09972608ed89f8377c6665542d5f450f0a6 | Open original |
| Janady13/missionmatch / internal/platform/bls/occupations_test.go | m5-price-to-win | 41000ad30fff4129fdaf5ec84e15ba14c27d4890 | Open original |
| Janady13/missionmatch / internal/platform/bls/occupations_test.go | master | 1e9249840a4302ec82e123b9c9cb6f75badea3e4 | Open original |
| Janady13/missionmatch / internal/platform/bls/occupations_test.go | mag-substrate | b82c7100a492dec67dfd1eda6b3f53def859be35 | Open original |
| Janady13/missionmatch / internal/platform/bls/occupations_test.go | time-to-fill-survival | b66e1e505863d4f17741a4b9ede73509e45bd6c6 | Open original |
| Janady13/missionmatch / internal/platform/bls/occupations_test.go | presentation-readiness | eb574acaa29d71ce4d0f852572e87c275c79fdb7 | Open original |
| Janady13/missionmatch / internal/platform/bls/occupations_test.go | vendor-intelligence | fe9796a19c261951d3f2565206c0c1b5ac294465 | Open original |
| Janady13/missionmatch / internal/platform/bls/occupations_test.go | phase2-connectors | e038d4c687aec16f8bd9bc4d907eea14d91f8704 | Open original |
| Janady13/missionmatch / internal/platform/bls/occupations_test.go | feature/aioe-upgrade | 2178e7298d0e5d9af83afa12402fd587f0ba6ed8 | Open original |
| Janady13/missionmatch / internal/platform/bls/occupations_test.go | capture-readiness | bae6af7cb2997e819174a9e9cfff5e16067a1975 | Open original |
Recovered source transcript
Download complete source text ↓64 lines · 2.7 KB
package bls
import (
"context"
"strings"
"testing"
)
// TestParseDetailedOccupationsKeepsOnlyDisplayLevel3 pins the oe.occupation parser: given a tab delimited
// flat file with a header row, aggregate roll up rows (display level 0, 1, 2), and detailed SOC rows
// (display level 3), it keeps ONLY the detailed occupations and captures the six digit SOC and the OEWS
// title. A malformed short row and a blank row are skipped rather than failing the parse.
func TestParseDetailedOccupationsKeepsOnlyDisplayLevel3(t *testing.T) {
// Columns: occupation_code, occupation_name, occupation_description, display_level, selectable, sort_sequence.
flat := strings.Join([]string{
"occupation_code\toccupation_name\toccupation_description\tdisplay_level\tselectable\tsort_sequence",
"000000\tAll Occupations\tAll occupations rollup\t0\tT\t1",
"110000\tManagement Occupations\tManagement rollup\t1\tT\t2",
"113021\tComputer and Information Systems Managers\tManage computer systems\t3\tT\t10",
"150000\tComputer and Mathematical Occupations\tComputer rollup\t2\tT\t20",
"151212\tInformation Security Analysts\tPlan security measures\t3\tT\t30",
"151252\tSoftware Developers\tDevelop software\t3\tT\t40",
"", // a blank row must be skipped
"999999\tShort Row", // a malformed short row must be skipped, not crash
}, "\n")
occs, err := ParseDetailedOccupations(strings.NewReader(flat))
if err != nil {
t.Fatalf("parse occupation list: %v", err)
}
if len(occs) != 3 {
t.Fatalf("only the three display level 3 rows are detailed SOCs, got %d: %+v", len(occs), occs)
}
want := map[string]string{
"113021": "Computer and Information Systems Managers",
"151212": "Information Security Analysts",
"151252": "Software Developers",
}
for _, o := range occs {
title, ok := want[o.SOC]
if !ok {
t.Errorf("unexpected SOC kept: %q", o.SOC)
continue
}
if o.Title != title {
t.Errorf("SOC %q title = %q, want %q", o.SOC, o.Title, title)
}
}
// The header row, the rollups, the blank, and the short row must never appear.
for _, o := range occs {
if o.SOC == "occupation_code" || o.SOC == "000000" || o.SOC == "110000" || o.SOC == "150000" || o.SOC == "999999" {
t.Errorf("a non detailed row leaked into the result: %q", o.SOC)
}
}
}
// TestFetchDetailedOccupationsRequiresUserAgent proves the download refuses an empty User Agent before any
// request is made, since BLS returns 403 to a default or empty User Agent. No network is touched.
func TestFetchDetailedOccupationsRequiresUserAgent(t *testing.T) {
if _, err := FetchDetailedOccupations(context.Background(), nil, "http://example.invalid", ""); err == nil {
t.Fatal("an empty User Agent must be rejected before the BLS request")
}
}